summaryrefslogtreecommitdiff
path: root/libc/stdlib
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-08-30 17:38:27 +0000
committerEric Andersen <andersen@codepoet.org>2001-08-30 17:38:27 +0000
commita5b6b616f884090adf9a8ef25b3bbf0175506489 (patch)
tree22a42b06164563d09fd6b82c7bfcc72d179fed09 /libc/stdlib
parent44a6b946f347d1c7dda76d0ed154c852f7445717 (diff)
"Kim B. Heino" <Kim.Heino@bluegiga.com> 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.
Diffstat (limited to 'libc/stdlib')
-rw-r--r--libc/stdlib/bsd_getpt.c2
1 files changed, 1 insertions, 1 deletions
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. */