archivers/grp.c
changeset 39 bc29e1ee7ef6
parent 37 768c8484b0cd
child 41 ff60d39d0862
equal deleted inserted replaced
38:feb16343f44c 39:bc29e1ee7ef6
   220         BAIL_IF_MACRO(fread(buf, 16, 1, fh) != 1, strerror(errno), retval);
   220         BAIL_IF_MACRO(fread(buf, 16, 1, fh) != 1, strerror(errno), retval);
   221 
   221 
   222         buf[12] = '\0';  /* FILENAME.EXT is all you get. */
   222         buf[12] = '\0';  /* FILENAME.EXT is all you get. */
   223 
   223 
   224         l = (LinkedStringList *) malloc(sizeof (LinkedStringList));
   224         l = (LinkedStringList *) malloc(sizeof (LinkedStringList));
   225         if (l != NULL)
   225         if (l == NULL)
   226             break;
   226             break;
   227 
   227 
   228         l->str = (char *) malloc(strlen(buf) + 1);
   228         l->str = (char *) malloc(strlen(buf) + 1);
   229         if (l->str == NULL)
   229         if (l->str == NULL)
   230         {
   230         {
   231             free(l);
   231             free(l);
   232             break;
   232             break;
   233         } /* if */
   233         } /* if */
       
   234 
       
   235         strcpy(l->str, buf);
   234 
   236 
   235         if (retval == NULL)
   237         if (retval == NULL)
   236             retval = l;
   238             retval = l;
   237         else
   239         else
   238             prev->next = l;
   240             prev->next = l;