diff options
-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) |