X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/1c91be5784ddebaa6a54f1f2c42a8016f10af6de..95e0df2af:/uip/mhcachesbr.c?ds=inline diff --git a/uip/mhcachesbr.c b/uip/mhcachesbr.c index 7814d6ee..7ac0a0de 100644 --- a/uip/mhcachesbr.c +++ b/uip/mhcachesbr.c @@ -9,7 +9,6 @@ #include #include -#include #include #include #include @@ -38,7 +37,7 @@ char *cache_private; /* mhmisc.c */ -int part_ok (CT, int); +int part_ok (CT); int type_ok (CT, int); void content_error (char *, CT, char *, ...); void flush_errors (void); @@ -136,7 +135,9 @@ cache_content (CT ct) while ((cc = fread (buffer, sizeof(*buffer), sizeof(buffer), gp)) > 0) - fwrite (buffer, sizeof(*buffer), cc, fp); + if ((int) fwrite (buffer, sizeof(*buffer), cc, fp) < cc) { + advise ("cache_content", "fwrite"); + } fflush (fp); if (ferror (gp)) { @@ -230,7 +231,7 @@ got_it: /* Now, construct query */ if (writing) { - snprintf (bp, buflen, "Make cached, publically-accessible copy"); + snprintf (bp, buflen, "Make cached, publicly-accessible copy"); } else { struct stat st; @@ -257,7 +258,7 @@ got_it: snprintf (bp, buflen, "\n in file %s? ", buffer); /* Now, check answer */ - if (!getanswer (query)) + if (!read_yes_or_no_if_tty (query)) status = NOTOK; } @@ -387,7 +388,7 @@ find_cache_aux2 (char *mapfile, char *id, char *mapname, int namelen) if (state != FLDPLUS) cp = buf; else { - cp = add (buf, NULL); + cp = mh_xstrdup(buf); while (state == FLDPLUS) { bufsz = sizeof buf; state = m_getfld (&gstate, name, buf, &bufsz, fp);