X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fm_getfld2.c;h=956a5565485ac54f6ed521db538741076a232e57;hp=18ad81283d015f00092fd23df55d43851a94bf40;hb=f78e7c6e6e616cc4ff2bee8a726365fafef2d8ce;hpb=cdb32d069bdcb6fa04ca7e3d87240442665611b0 diff --git a/sbr/m_getfld2.c b/sbr/m_getfld2.c index 18ad812..956a556 100644 --- a/sbr/m_getfld2.c +++ b/sbr/m_getfld2.c @@ -10,7 +10,6 @@ #include #include #include -#include enum threestate { @@ -24,7 +23,7 @@ enum threestate { */ static enum threestate is_falted(FILE *); static size_t copyname(char *, char *); -static bool is_separator(char *); +static boolean is_separator(char *); /* @@ -97,7 +96,7 @@ m_getfld2(enum state s, struct field *f, FILE *msg) f->valuelen = nchars; } - while (ret == FLD2 && (falted = is_falted(msg)) == B_TRUE) { + while ((ret == FLD2 || ret == LENERR2) && (falted = is_falted(msg)) == B_TRUE) { nchars = getline(&tmpline, &len, msg); if (nchars <= 0) { free(tmpline); @@ -146,10 +145,6 @@ m_getfld2(enum state s, struct field *f, FILE *msg) } } - if (nchars >= NAMESZ) { - ret = LENERR2; - } - free(f->value); f->value = tmpline; f->valuelen = nchars; @@ -214,7 +209,7 @@ copyname(char *dst, char *src) return strlen(dst); } -static bool +static boolean is_separator(char *line) { /* @@ -225,7 +220,7 @@ is_separator(char *line) line++; } if (strcmp("\n", line) == 0 || strcmp("\r\n", line) == 0 ) { - return true; + return TRUE; } - return false; + return FALSE; }