diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-05-05 08:15:17 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-05-05 08:15:17 +0300 |
commit | b15e3e3ca1f09163fcb392a15fefb36581b101e2 (patch) | |
tree | 65b59f94fa46e01d377b71bcd91f4b9b8bdcef65 /tools | |
parent | 961b6c4b2f9c2cd4663f85fdb38906765e3640aa (diff) | |
download | rpm-b15e3e3ca1f09163fcb392a15fefb36581b101e2.tar.gz rpm-b15e3e3ca1f09163fcb392a15fefb36581b101e2.tar.bz2 rpm-b15e3e3ca1f09163fcb392a15fefb36581b101e2.zip |
Silence bogus warning on memset()
- gcc doesn't realize shrank == 0 would terminate the process via error()
before reaching memset(), work around...
Diffstat (limited to 'tools')
-rw-r--r-- | tools/debugedit.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/debugedit.c b/tools/debugedit.c index c298cd295..27e669101 100644 --- a/tools/debugedit.c +++ b/tools/debugedit.c @@ -650,9 +650,12 @@ edit_dwarf2_line (DSO *dso, uint32_t off, char *comp_dir, int phase) if (--shrank == 0) error (EXIT_FAILURE, 0, "canonicalization unexpectedly shrank by one character"); - memset (ptr, 'X', shrank); - ptr += shrank; - *ptr++ = '\0'; + else + { + memset (ptr, 'X', shrank); + ptr += shrank; + *ptr++ = '\0'; + } } if (abs_dir_cnt + abs_file_cnt != 0) |