X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Flexer%2Fformat-parser.c;h=aa4729b063ffaa780da433b92d7a9e979cf8121d;hb=762876f19fa870401ae882515de1b58703b73ac4;hp=69a83b78676fe5f8ec6d1ceb73595461012ccf61;hpb=a19b858e0ac3c69e4a28c0ca6d8674427268a863;p=pspp diff --git a/src/language/lexer/format-parser.c b/src/language/lexer/format-parser.c index 69a83b7867..aa4729b063 100644 --- a/src/language/lexer/format-parser.c +++ b/src/language/lexer/format-parser.c @@ -45,7 +45,7 @@ parse_format_specifier_name (const char **cp, enum fmt_parse_flags flags) char *sp, *ep; int idx; - sp = ep = ds_c_str (&tokstr); + sp = ep = ds_cstr (&tokstr); while (isalpha ((unsigned char) *ep)) ep++; @@ -72,7 +72,7 @@ parse_format_specifier_name (const char **cp, enum fmt_parse_flags flags) /* No match. */ if (!(flags & FMTP_SUPPRESS_ERRORS)) msg (SE, _("%.*s is not a valid data format."), - (int) (ep - sp), ds_c_str (&tokstr)); + (int) (ep - sp), ds_cstr (&tokstr)); idx = -1; } } @@ -125,7 +125,12 @@ parse_format_specifier (struct fmt_spec *input, enum fmt_parse_flags flags) { if (!(flags & FMTP_SUPPRESS_ERRORS)) msg (SE, _("Data format %s does not specify a width."), - ds_c_str (&tokstr)); + ds_cstr (&tokstr)); + return 0; + } + if ( w > MAX_STRING ) + { + msg (SE, _("String variable width may not exceed %d"), MAX_STRING); return 0; } @@ -142,7 +147,7 @@ parse_format_specifier (struct fmt_spec *input, enum fmt_parse_flags flags) if (*cp) { if (!(flags & FMTP_SUPPRESS_ERRORS)) - msg (SE, _("Data format %s is not valid."), ds_c_str (&tokstr)); + msg (SE, _("Data format %s is not valid."), ds_cstr (&tokstr)); return 0; } lex_get ();