diff options
author | Philipp Kloke <philipp.kloke@web.de> | 2013-03-31 11:59:22 +0200 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2013-04-01 02:11:01 +0400 |
commit | c51a224ceb9ebdc8ee4477a92d79f070918abf36 (patch) | |
tree | fcc0111e3fc9583fefe14601e433f03ab0e890e4 /output | |
parent | 94ba02fa16593ac1c6f0a99edce551b79f66e03b (diff) | |
download | nasm-c51a224ceb9ebdc8ee4477a92d79f070918abf36.tar.gz nasm-c51a224ceb9ebdc8ee4477a92d79f070918abf36.tar.bz2 nasm-c51a224ceb9ebdc8ee4477a92d79f070918abf36.zip |
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 <philipp.kloke@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'output')
-rw-r--r-- | output/outcoff.c | 3 |
1 files changed, 0 insertions, 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); |