From: Karel Zak Date: Wed, 17 Jan 2007 13:27:15 +0000 (+0100) Subject: hexdump: don't use memset with zero lenght X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42c9ce52aaf4d5a060ac435a9a988005a8e0807a;p=util-linux hexdump: don't use memset with zero lenght gcc 4.1.0: "warning: memset used with constant zero length parameter...." Signed-off-by: Karel Zak --- diff --git a/text-utils/display.c b/text-utils/display.c index 25d7f043..3d4bdcd9 100644 --- a/text-utils/display.c +++ b/text-utils/display.c @@ -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); }