summaryrefslogtreecommitdiff
path: root/usr.bin/diff/diffreg.c
diff options
context:
space:
mode:
authorVincent Labrecque <vincent@cvs.openbsd.org>2003-06-26 04:47:31 +0000
committerVincent Labrecque <vincent@cvs.openbsd.org>2003-06-26 04:47:31 +0000
commit66b79825bd8d3fc6e7c2c04a33fd1a7beb11a16c (patch)
treefa651a2b794fb5fe4fc1ceef2310817dab2e1229 /usr.bin/diff/diffreg.c
parent9851b778757345ce17eab2a8e0e5eedac2c7685f (diff)
off by one in size calculation
ok tedu
Diffstat (limited to 'usr.bin/diff/diffreg.c')
-rw-r--r--usr.bin/diff/diffreg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c
index e4c2123da31..a5467e1ae57 100644
--- a/usr.bin/diff/diffreg.c
+++ b/usr.bin/diff/diffreg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diffreg.c,v 1.18 2003/06/25 22:38:11 tedu Exp $ */
+/* $OpenBSD: diffreg.c,v 1.19 2003/06/26 04:47:30 vincent Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
@@ -381,7 +381,7 @@ splice(char *dir, char *file)
tail = file;
else
tail++;
- len = strlen(dir) + strlen(tail) + 1;
+ len = strlen(dir) + 1 + strlen(tail) + 1;
buf = emalloc(len);
snprintf(buf, len, "%s/%s", dir, tail);
return (buf);