X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fdata%2Fdata-in.c;h=b0120677b3f7b079d78e7a15c4c17a5073612ac7;hb=feba48309a227fe40feb3a87cbe900015021ac73;hp=db99aa4fb896d9d8f99657b2e7c6caf41940948e;hpb=2379d3e11b55c11e7760b4f0ba4c14519aec28a3;p=pspp diff --git a/src/data/data-in.c b/src/data/data-in.c index db99aa4fb8..b0120677b3 100644 --- a/src/data/data-in.c +++ b/src/data/data-in.c @@ -76,7 +76,11 @@ static int hexit_value (int c); Stores the parsed representation in OUTPUT, which the caller must have initialized with the given WIDTH (0 for a numeric field, otherwise the string width). If FORMAT is FMT_A, then OUTPUT_ENCODING must specify the - correct encoding for OUTPUT (normally obtained via dict_get_encoding()). */ + correct encoding for OUTPUT (normally obtained via dict_get_encoding()). + + If successful NULL is the return value. Otherwise a string describing + the problem is returned. The caller must free this string. + */ char * data_in (struct substring input, const char *input_encoding, enum fmt_type format, @@ -919,7 +923,7 @@ parse_year (struct data_in *i, long *year, size_t max_digits) else *year += epoch_century + 100; } - if (*year >= 1582 || *year <= 19999) + if (*year >= 1582 && *year <= 19999) return NULL; return xasprintf (_("Year (%ld) must be between 1582 and 19999."), *year);