/* 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
{
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];