diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-08-30 17:38:27 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-08-30 17:38:27 +0000 |
commit | a5b6b616f884090adf9a8ef25b3bbf0175506489 (patch) | |
tree | 22a42b06164563d09fd6b82c7bfcc72d179fed09 /libc | |
parent | 44a6b946f347d1c7dda76d0ed154c852f7445717 (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')
-rw-r--r-- | libc/stdlib/bsd_getpt.c | 2 |
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. */ |