]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: df: avoid sizeof(char**) static analysis warning
authorBernhard Voelker <mail@bernhard-voelker.de>
Wed, 16 Apr 2014 08:43:09 +0000 (10:43 +0200)
committerBernhard Voelker <mail@bernhard-voelker.de>
Wed, 16 Apr 2014 08:43:09 +0000 (10:43 +0200)
* src/df.c (alloc_table_row): Use the size of char** to enlarge
the table.  Spotted by Coverity.

src/df.c

index 3036c74ab644f78340340bfbe69e3626914e3ed8..e7639434e60bacbba33764c0119a4e9f77308eed 100644 (file)
--- a/src/df.c
+++ b/src/df.c
@@ -290,7 +290,7 @@ static void
 alloc_table_row (void)
 {
   nrows++;
-  table = xnrealloc (table, nrows, sizeof (char *));
+  table = xnrealloc (table, nrows, sizeof (char **));
   table[nrows - 1] = xnmalloc (ncolumns, sizeof (char *));
 }