X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/116b286a03fe33db3db24a56fa3518d237f5b8c2..6e1d79d58e5da5ba06bc42ebebd2f6f8f2ceb52e:/uip/mhstoresbr.c?ds=sidebyside diff --git a/uip/mhstoresbr.c b/uip/mhstoresbr.c index 7e91563f..a2bc919e 100644 --- a/uip/mhstoresbr.c +++ b/uip/mhstoresbr.c @@ -395,7 +395,7 @@ missing_part: ct = *ctq++; if (store_content (ct, NULL, info) == NOTOK) { losing: - free ((char *) base); + free(base); return NOTOK; } @@ -405,7 +405,7 @@ losing: goto losing; } - free ((char *) base); + free(base); return OK; } @@ -650,7 +650,7 @@ got_filename: if (first_partial) fprintf (stderr, "reassembling partials "); if (last_partial) - fprintf (stderr, "%s", ct->c_file); + fputs(ct->c_file, stderr); else fprintf (stderr, "%s,", ct->c_file); } else { @@ -674,7 +674,7 @@ got_filename: int cwdlen = strlen (info->cwd); fprintf (stderr, " as file %s\n", - strncmp (ct->c_storage, info->cwd, cwdlen) + !HasPrefix(ct->c_storage, info->cwd) || ct->c_storage[cwdlen] != '/' ? ct->c_storage : ct->c_storage + cwdlen + 1); } @@ -835,7 +835,7 @@ losing: } } - while (fgets (buffer, sizeof(buffer) - 1, ct->c_fp)) { + while (fgets (buffer, sizeof buffer, ct->c_fp)) { if ((pos += strlen (buffer)) > last) { int diff; @@ -1078,8 +1078,7 @@ get_storeproc (CT ct) free(cp); return; } - if (cp) - free(cp); + mh_xfree(cp); } /* @@ -1097,8 +1096,7 @@ get_storeproc (CT ct) ct->c_storeproc = add (cp, NULL); } - if (cp) - free(cp); + mh_xfree(cp); }