X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fdatasheet.c;h=f76b1908d50f1dbdeeff94af7f9d6ecd2150ca16;hb=20030d3202400f0ce981589d19b4ed53927647b6;hp=1fc1e98b08aba877620733f90a12a225a0be4f36;hpb=5da5a98055ad574120c3e3922af097411a0dcf3a;p=pspp-builds.git
diff --git a/src/data/datasheet.c b/src/data/datasheet.c
index 1fc1e98b..f76b1908 100644
--- a/src/data/datasheet.c
+++ b/src/data/datasheet.c
@@ -1,20 +1,18 @@
-/* PSPP - computes sample statistics.
+/* PSPP - a program for statistical analysis.
Copyright (C) 2007 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 the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+ 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
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA. */
+ along with this program. If not, see . */
#include
@@ -356,6 +354,8 @@ datasheet_delete_columns (struct datasheet *ds, size_t start, size_t cnt)
{
size_t lcol;
+ assert ( start + cnt <= axis_get_size (ds->columns) );
+
/* Free up columns for reuse. */
for (lcol = start; lcol < start + cnt; lcol++)
{
@@ -428,6 +428,7 @@ bool
datasheet_get_value (const struct datasheet *ds, casenumber row, size_t column,
union value *value, int width)
{
+ assert ( row >= 0 );
return rw_case ((struct datasheet *) ds,
OP_READ, row, column, value_cnt_from_width (width), value);
}