aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorStephane E. Potvin <sepotvin@FreeBSD.org>2009-09-24 20:43:08 +0000
committerStephane E. Potvin <sepotvin@FreeBSD.org>2009-09-24 20:43:08 +0000
commit0c6c8b3e8f6654d41fb5f7206ab3590ccf5a8069 (patch)
treecde3e0d6e6886fda6d10728233bed85e325f6693 /gnu
parent8b1e4172cb5f70ebdc598b53a3e5349008002b2d (diff)
Notes
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/patch/common.h1
-rw-r--r--gnu/usr.bin/patch/pch.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/gnu/usr.bin/patch/common.h b/gnu/usr.bin/patch/common.h
index 7063be682429..aa191054aa17 100644
--- a/gnu/usr.bin/patch/common.h
+++ b/gnu/usr.bin/patch/common.h
@@ -34,6 +34,7 @@
#define Strcpy (void)strcpy
#define Strcat (void)strcat
#define Strlcpy (void)strlcpy
+#define Strncpy (void)strncpy
#define Strlcat (void)strlcat
/* NeXT declares malloc and realloc incompatibly from us in some of
diff --git a/gnu/usr.bin/patch/pch.c b/gnu/usr.bin/patch/pch.c
index 1638241151a6..e4fd8eec6cd4 100644
--- a/gnu/usr.bin/patch/pch.c
+++ b/gnu/usr.bin/patch/pch.c
@@ -1152,7 +1152,8 @@ pgets(bool do_indent)
indent++;
}
}
- Strlcpy(buf, line, len + 1 - skipped);
+ Strncpy(buf, line, len - skipped);
+ buf[len - skipped] = '\0';
}
return len;
}