projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed intialization of coefficients
[pspp]
/
src
/
language
/
lexer
/
format-parser.c
diff --git
a/src/language/lexer/format-parser.c
b/src/language/lexer/format-parser.c
index b3ccba55ced7b4d559966817c438b878ce87a1f8..aa4729b063ffaa780da433b92d7a9e979cf8121d 100644
(file)
--- a/
src/language/lexer/format-parser.c
+++ b/
src/language/lexer/format-parser.c
@@
-18,15
+18,15
@@
02110-1301, USA. */
#include <config.h>
02110-1301, USA. */
#include <config.h>
-#include
"format.h"
+#include
<data/format.h>
#include <ctype.h>
#include <ctype.h>
-#include
"message.h"
+#include
<libpspp/message.h>
#include <stdlib.h>
#include <stdlib.h>
-#include
"message.h"
+#include
<libpspp/message.h>
#include "lexer.h"
#include "lexer.h"
-#include
"misc.h"
-#include
"str.h"
-#include
"variable.h"
+#include
<libpspp/misc.h>
+#include
<libpspp/str.h>
+#include
<data/variable.h>
#include "gettext.h"
#define _(msgid) gettext (msgid)
#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;
char *sp, *ep;
int idx;
- sp = ep = ds_c
_
str (&tokstr);
+ sp = ep = ds_cstr (&tokstr);
while (isalpha ((unsigned char) *ep))
ep++;
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."),
/* 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;
}
}
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."),
{
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;
}
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))
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 ();
return 0;
}
lex_get ();