summaryrefslogtreecommitdiff
path: root/usr.bin/nm/nm.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/nm/nm.c')
-rw-r--r--usr.bin/nm/nm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/nm/nm.c b/usr.bin/nm/nm.c
index 5d2a1bfeb61..f9ad9399b86 100644
--- a/usr.bin/nm/nm.c
+++ b/usr.bin/nm/nm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nm.c,v 1.51 2015/12/09 19:28:34 mmcc Exp $ */
+/* $OpenBSD: nm.c,v 1.52 2017/09/12 08:32:44 mpi Exp $ */
/* $NetBSD: nm.c,v 1.7 1996/01/14 23:04:03 pk Exp $ */
/*
@@ -310,7 +310,7 @@ mmbr_name(struct ar_hdr *arh, char **name, int baselen, int *namelen, FILE *fp)
int len;
i = atol(&arh->ar_name[1]);
- len = strlen(&nametab[i]);
+ len = strlen(&nametab[i]) + 1;
if (len > *namelen) {
p -= (long)*name;
if ((*name = realloc(*name, baselen+len)) == NULL)
@@ -319,7 +319,7 @@ mmbr_name(struct ar_hdr *arh, char **name, int baselen, int *namelen, FILE *fp)
p += (long)*name;
}
strlcpy(p, &nametab[i], len);
- p += len;
+ p += len - 1;
} else
#ifdef AR_EFMT1
/*