02110-1301, USA. */
#include <config.h>
-#include "format.h"
+#include <data/format.h>
#include <ctype.h>
-#include "message.h"
+#include <libpspp/message.h>
#include <stdlib.h>
-#include "message.h"
+#include <libpspp/message.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)
char *sp, *ep;
int idx;
- sp = ep = ds_c_str (&tokstr);
+ sp = ep = ds_cstr (&tokstr);
while (isalpha ((unsigned char) *ep))
ep++;
/* 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;
}
}
{
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;
}
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 ();