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

Diff for /src/usr.bin/mg/tags.c between version 1.21 and 1.22

version 1.21, 2023/03/22 18:18:35 version 1.22, 2023/03/22 19:42:41
Line 367 
Line 367 
  * l, and can be freed during cleanup.   * l, and can be freed during cleanup.
  */   */
 int  int
 addctag(char *l)  addctag(char *s)
 {  {
         struct ctag *t = NULL;          struct ctag *t = NULL;
           char *l;
   
         if ((t = malloc(sizeof(struct ctag))) == NULL) {          if ((t = malloc(sizeof(struct ctag))) == NULL) {
                 dobeep();                  dobeep();
                 ewprintf("Out of memory");                  ewprintf("Out of memory");
                 goto cleanup;                  goto cleanup;
         }          }
         t->tag = l;          t->tag = s;
         if ((l = strchr(l, '\t')) == NULL)          if ((l = strchr(s, '\t')) == NULL)
                 goto cleanup;                  goto cleanup;
         *l++ = '\0';          *l++ = '\0';
         t->fname = l;          t->fname = l;
Line 391 
Line 392 
         return (TRUE);          return (TRUE);
 cleanup:  cleanup:
         free(t);          free(t);
         free(l);          free(s);
         return (FALSE);          return (FALSE);
 }  }
   

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22