X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata-in.c;h=945cafd734ae38dc2af3f991776a69a6a29723f3;hb=682e5ee9e871b66d5227468bfa2ae3bc7b7d14cc;hp=f7224cc01d2050050dfa70361f2ccde4661ceb8d;hpb=4fdeb2145d081ff1b84e3f6c99f9d1c048c0d64a;p=pspp diff --git a/src/data-in.c b/src/data-in.c index f7224cc01d..945cafd734 100644 --- a/src/data-in.c +++ b/src/data-in.c @@ -212,9 +212,7 @@ parse_numeric (struct data_in *i) return false; } - if (have_char (i) - && (tolower (*i->s) == 'e' || tolower (*i->s) == 'd' - || (type == FMT_E && (*i->s == '+' || *i->s == '-')))) + if (have_char (i) && strchr ("eEdD-+", *i->s)) { /* Get the exponent specified after the `e' or `E'. */ long exp; @@ -468,7 +466,7 @@ parse_IB (struct data_in *i) p = i->s; #else memcpy (buf, i->s, i->e - i->s); - mm_reverse (buf, i->e - i->s); + buf_reverse (buf, i->e - i->s); p = buf; #endif @@ -760,7 +758,7 @@ parse_enum (struct data_in *i, const char *what, if ((ep->can_abbreviate && lex_id_match_len (ep->name, strlen (ep->name), name, length)) || (!ep->can_abbreviate && length == strlen (ep->name) - && !memcmp (name, ep->name, length))) + && !buf_compare_case (name, ep->name, length))) { *output = ep->value; return true; @@ -1363,6 +1361,8 @@ data_in (struct data_in *i) { const struct fmt_desc *const fmt = &formats[i->format.type]; + assert (check_input_specifier (&i->format, 0)); + /* Check that we've got a string to work with. */ if (i->e == i->s || i->format.w <= 0) {