X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Flexer%2Fformat-parser.c;h=aa4729b063ffaa780da433b92d7a9e979cf8121d;hb=b1b43c0d6a64d29a13953aa15d98dd74117faa95;hp=b3ccba55ced7b4d559966817c438b878ce87a1f8;hpb=dcf9b154cbcaa35c3d8459a201b77eec8bcb30bd;p=pspp diff --git a/src/language/lexer/format-parser.c b/src/language/lexer/format-parser.c index b3ccba55ce..aa4729b063 100644 --- a/src/language/lexer/format-parser.c +++ b/src/language/lexer/format-parser.c @@ -18,15 +18,15 @@ 02110-1301, USA. */ #include -#include "format.h" +#include #include -#include "message.h" +#include #include -#include "message.h" +#include #include "lexer.h" -#include "misc.h" -#include "str.h" -#include "variable.h" +#include +#include +#include #include "gettext.h" #define _(msgid) gettext (msgid) @@ -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 ();