[BACK]Return to strings.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mail

Diff for /src/usr.bin/mail/strings.c between version 1.5 and 1.6

version 1.5, 1997/07/14 00:24:30 version 1.6, 1997/11/14 00:23:58
Line 65 
Line 65 
 salloc(size)  salloc(size)
         int size;          int size;
 {  {
         register char *t;          char *t;
         register int s;          int s;
         register struct strings *sp;          struct strings *sp;
         int index;          int index;
   
         s = size;          s = size;
Line 82 
Line 82 
                 index++;                  index++;
         }          }
         if (sp >= &stringdope[NSPACE])          if (sp >= &stringdope[NSPACE])
                 panic("String too large");                  errx(1, "String too large");
         if (sp->s_topFree == NULL) {          if (sp->s_topFree == NULL) {
                 index = sp - &stringdope[0];                  index = sp - &stringdope[0];
                 sp->s_topFree = (char *)malloc(STRINGSIZE << index);                  sp->s_topFree = (char *)malloc(STRINGSIZE << index);
                 if (sp->s_topFree == NULL) {                  if (sp->s_topFree == NULL)
                         fprintf(stderr, "No room for space %d\n", index);                          errx(1, "No room for space %d", index);
                         panic("Internal error");  
                 }  
                 sp->s_nextFree = sp->s_topFree;                  sp->s_nextFree = sp->s_topFree;
                 sp->s_nleft = STRINGSIZE << index;                  sp->s_nleft = STRINGSIZE << index;
         }          }
Line 107 
Line 105 
 void  void
 sreset()  sreset()
 {  {
         register struct strings *sp;          struct strings *sp;
         register int index;          int index;
   
         if (noreset)          if (noreset)
                 return;                  return;
Line 129 
Line 127 
 void  void
 spreserve()  spreserve()
 {  {
         register struct strings *sp;          struct strings *sp;
   
         for (sp = &stringdope[0]; sp < &stringdope[NSPACE]; sp++)          for (sp = &stringdope[0]; sp < &stringdope[NSPACE]; sp++)
                 sp->s_topFree = NULL;                  sp->s_topFree = NULL;

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6