From: Ben Pfaff Date: Thu, 26 Jan 2012 04:47:13 +0000 (-0800) Subject: pspp-dump-sav: Fix sizeof on "array" that is actually a pointer. X-Git-Tag: v0.7.9~17 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23f9ab5825de755eccc51a602f57d0e8ae53eab5;p=pspp-builds.git pspp-dump-sav: Fix sizeof on "array" that is actually a pointer. Found by clang. Reported-by: Jeremy Lavergne --- diff --git a/utilities/pspp-dump-sav.c b/utilities/pspp-dump-sav.c index 7cdd7d9c..54e4712b 100644 --- a/utilities/pspp-dump-sav.c +++ b/utilities/pspp-dump-sav.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. + Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 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 @@ -459,7 +459,7 @@ print_untyped_value (struct sfm_reader *r, char raw_value[8]) double value; value = float_get_double (r->float_format, raw_value); - for (n_printable = 0; n_printable < sizeof raw_value; n_printable++) + for (n_printable = 0; n_printable < 8; n_printable++) if (!isprint (raw_value[n_printable])) break;