aboutsummaryrefslogtreecommitdiff
path: root/gdb/nbsd-nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/nbsd-nat.c')
-rw-r--r--gdb/nbsd-nat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/nbsd-nat.c b/gdb/nbsd-nat.c
index 14b562f..7f5df66 100644
--- a/gdb/nbsd-nat.c
+++ b/gdb/nbsd-nat.c
@@ -34,7 +34,7 @@ nbsd_pid_to_exec_file (int pid)
char *path;
path = xstrprintf ("/proc/%d/exe", pid);
- if (readlink (path, buf, MAXPATHLEN) == -1)
+ if (readlink (path, buf, MAXPATHLEN - 1) == -1)
{
xfree (buf);
buf = NULL;