From: John Darrington Date: Sat, 9 May 2009 00:43:35 +0000 (+0800) Subject: Ensure that NUMERIC's format (if any) is a valid output format. X-Git-Tag: v0.6.2-pre1~6 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=389b447a91e26f255e79c4fd8520d99931809ed0;p=pspp-builds.git Ensure that NUMERIC's format (if any) is a valid output format. Thanks to Pascal Barbedor for reporting this problem. --- diff --git a/src/language/dictionary/numeric.c b/src/language/dictionary/numeric.c index 5c64b948..5fa77541 100644 --- a/src/language/dictionary/numeric.c +++ b/src/language/dictionary/numeric.c @@ -43,12 +43,12 @@ cmd_numeric (struct lexer *lexer, struct dataset *ds) char **v; size_t nv; - /* Format spec for variables to create. f.type==-1 if default is to - be used. */ - struct fmt_spec f; - do { + /* Format spec for variables to create. f.type==-1 if default is to + be used. */ + struct fmt_spec f; + if (!parse_DATA_LIST_vars (lexer, &v, &nv, PV_NONE)) return CMD_FAILURE; @@ -57,6 +57,10 @@ cmd_numeric (struct lexer *lexer, struct dataset *ds) { if (!parse_format_specifier (lexer, &f)) goto fail; + + if ( ! fmt_check_output (&f)) + goto fail; + if (fmt_is_string (f.type)) { char str[FMT_STRING_LEN_MAX + 1];