Otherwise dissect-sysfile would not print the last long string
variable name written by sys-file-writer, because it did not include
a separator byte after the last record. (This was obvious running
dissect-sysfile on a system file with only one variable.)
/* PSPP - a program for statistical analysis.
/* 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
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
&& text->buffer[text->pos] != delimiter
&& text->buffer[text->pos] != '\0')
text->pos++;
&& 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];
return NULL;
text->buffer[text->pos++] = '\0';
return &text->buffer[start];