/* PSPP - a program for statistical analysis.
- Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "gettext.h"
#define _(msgid) gettext (msgid)
-#define VAR_NAME_LEN 64
+#define ID_MAX_LEN 64
struct sfm_reader
{
if (!text_match (text, ' '))
{
- sys_warn (r, _("Missing space following 'E' at offset %zu "
- "in MRSETS record"), text_pos (text));
+ sys_warn (r, _("Missing space following `%c' at offset %zu "
+ "in MRSETS record"), 'E', text_pos (text));
break;
}
label_from_var_label = true;
else if (strcmp (number, "1"))
sys_warn (r, _("Unexpected label source value `%s' "
- "following 'E' at offset %zu in MRSETS record"),
+ "following `E' at offset %zu in MRSETS record"),
number, text_pos (text));
}
else
{
- sys_warn (r, "missing 'C', 'D', or 'E' at offset %zu "
+ sys_warn (r, "missing `C', `D', or `E' at offset %zu "
"in mrsets record", text_pos (text));
break;
}
while (ftello (r->file) - start < size * count)
{
long long posn = ftello (r->file);
- char var_name[VAR_NAME_LEN + 1];
+ char var_name[ID_MAX_LEN + 1];
int var_name_len;
int n_values;
int width;
/* Read variable name. */
var_name_len = read_int (r);
- if (var_name_len > VAR_NAME_LEN)
+ if (var_name_len > ID_MAX_LEN)
sys_error (r, _("Variable name length in long string value label "
"record (%d) exceeds %d-byte limit."),
- var_name_len, VAR_NAME_LEN);
+ var_name_len, ID_MAX_LEN);
read_string (r, var_name, var_name_len + 1);
/* Read width, number of values. */
&& text->buffer[text->pos] != delimiter
&& text->buffer[text->pos] != '\0')
text->pos++;
- if (text->pos == text->size)
+ if (start == text->pos)
return NULL;
text->buffer[text->pos++] = '\0';
return &text->buffer[start];