From c51a224ceb9ebdc8ee4477a92d79f070918abf36 Mon Sep 17 00:00:00 2001 From: Philipp Kloke Date: Sun, 31 Mar 2013 11:59:22 +0200 Subject: Remove unnecessary calls to memset The C standard guarantees that strncpy pads the string with zeros if source string is smaller than destination buffer. Signed-off-by: Philipp Kloke Signed-off-by: Cyrill Gorcunov --- output/outcoff.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/output/outcoff.c b/output/outcoff.c index 6c72806..258363f 100644 --- a/output/outcoff.c +++ b/output/outcoff.c @@ -945,7 +945,6 @@ static void coff_section_header(char *name, int32_t vsize, (void)vsize; - memset(padname, 0, 8); strncpy(padname, name, 8); fwrite(padname, 8, 1, ofile); @@ -998,7 +997,6 @@ static void coff_symbol(char *name, int32_t strpos, int32_t value, char padname[8]; if (name) { - memset(padname, 0, 8); strncpy(padname, name, 8); fwrite(padname, 8, 1, ofile); } else { @@ -1023,7 +1021,6 @@ static void coff_write_symbols(void) * The `.file' record, and the file name auxiliary record. */ coff_symbol(".file", 0L, 0L, -2, 0, 0x67, 1); - memset(filename, 0, 18); strncpy(filename, coff_infile, 18); fwrite(filename, 18, 1, ofile); -- cgit v1.2.3