]> err.no Git - util-linux/commitdiff
hexdump: don't use memset with zero lenght
authorKarel Zak <kzak@redhat.com>
Wed, 17 Jan 2007 13:27:15 +0000 (14:27 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 17 Jan 2007 13:27:15 +0000 (14:27 +0100)
gcc 4.1.0: "warning: memset used with constant zero length parameter...."

Signed-off-by: Karel Zak <kzak@redhat.com>
text-utils/display.c

index 25d7f043ab0d11a27a3e617a0d9c0894720539a0..3d4bdcd981a75705ccd4a2217a1626d3d7b3758a 100644 (file)
@@ -255,7 +255,8 @@ get(void)
                                        (void)printf("*\n");
                                return(NULL);
                        }
-                       memset((char *)curp + nread, 0, need);
+                       if (need > 0)
+                               memset((char *)curp + nread, 0, need);
                        eaddress = address + nread;
                        return(curp);
                }