summaryrefslogtreecommitdiff
path: root/binutils/dwarf.c
diff options
context:
space:
mode:
Diffstat (limited to 'binutils/dwarf.c')
-rw-r--r--binutils/dwarf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 386cc17f7c5..5f8922eb8aa 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -217,7 +217,10 @@ dwarf_vmatoa_1 (const char *fmtch, dwarf_vma value, unsigned num_bytes)
{
char fmt[32];
- sprintf (fmt, "%%%s%s", DWARF_VMA_FMT, fmtch);
+ if (fmtch)
+ sprintf (fmt, "%%%s%s", DWARF_VMA_FMT, fmtch);
+ else
+ sprintf (fmt, "%%%s", DWARF_VMA_FMT);
snprintf (ret, sizeof (buf[0].place), fmt, value);
return ret;
}