From a5b6b616f884090adf9a8ef25b3bbf0175506489 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 30 Aug 2001 17:38:27 +0000 Subject: "Kim B. Heino" reports In the libc/stdlib/bsd_getpt.c file you have line: memcpy (buf, _PATH_PTY, sizeof (_PATH_PTY) - 1); It really should be: memcpy (buf, _PATH_PTY, sizeof (_PATH_PTY) ); The last nul character must be copied too because the next line uses strlen() to get buf's length. --- libc/stdlib/bsd_getpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libc/stdlib/bsd_getpt.c') diff --git a/libc/stdlib/bsd_getpt.c b/libc/stdlib/bsd_getpt.c index 0f981ab95..0249abbde 100644 --- a/libc/stdlib/bsd_getpt.c +++ b/libc/stdlib/bsd_getpt.c @@ -48,7 +48,7 @@ __getpt (void) const char *p, *q; char *s; - memcpy (buf, _PATH_PTY, sizeof (_PATH_PTY) - 1); + memcpy (buf, _PATH_PTY, sizeof (_PATH_PTY)); s = buf + strlen (buf); /* s[0] and s[1] will be filled in the loop. */ -- cgit v1.2.3