X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fprompter.c;h=ea17b91a0194e0891291821da1eebca8748d47d5;hp=21ec5ced30543a44a11a5d9afd63917c84a1c70f;hb=e917512db8efcbf3b5b5baeb64b6d345fd3686db;hpb=a87df3543d3bc128ba4079d1f95638476ba5ca50 diff --git a/uip/prompter.c b/uip/prompter.c index 21ec5ce..ea17b91 100644 --- a/uip/prompter.c +++ b/uip/prompter.c @@ -57,7 +57,7 @@ main(int argc, char **argv) int fdi, fdo, i; char *cp, *drft = NULL; enum state state; - struct field f = free_field; + struct field f = {{0}}; char buffer[BUFSIZ], tmpfil[BUFSIZ]; char **arguments, **argp; FILE *in, *out; @@ -140,6 +140,10 @@ main(int argc, char **argv) */ for (state = FLD2;;) { switch (state = m_getfld2(state, &f, in)) { + case LENERR2: + state = FLD2; + /* FALL */ + case FLD2: /* ** Check if the value of field contains @@ -184,7 +188,7 @@ abort: case FILEEOF2: fprintf(out, "--------\n"); if (qbody) { - if (!*f.value) { + if (f.value == NULL) { printf("--------\n"); goto has_no_body; } @@ -212,6 +216,9 @@ abort: } } while ((state = m_getfld2(state, &f, in)) ==BODY2); + if (state != FILEEOF2) { + adios(EX_IOERR, "m_getfld2", "io error"); + } } if (prepend || !qbody) { @@ -230,8 +237,11 @@ has_no_body: } break; + case FMTERR2: + advise(NULL, "skeleton is poorly formatted"); + continue; default: - adios(EX_DATAERR, NULL, "skeleton is poorly formatted"); + adios(EX_IOERR, "m_getfld2", "io error"); } break; }