diff options
| author | Warner Losh <imp@FreeBSD.org> | 1998-09-16 04:17:47 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 1998-09-16 04:17:47 +0000 |
| commit | e8420087b0ae4a2d0611cd2f6413d150cfc83554 (patch) | |
| tree | 69de0b126d131ecd617d41b6eba03770319d92e3 /lib/libc/stdlib | |
| parent | e9363917832d4d492df8463833be0cd952076fa8 (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdlib')
| -rw-r--r-- | lib/libc/stdlib/realpath.c | 2 | ||||
| -rw-r--r-- | lib/libc/stdlib/setenv.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c index 998ef57912cf..b5177e9c221c 100644 --- a/lib/libc/stdlib/realpath.c +++ b/lib/libc/stdlib/realpath.c @@ -105,7 +105,7 @@ loop: errno = ELOOP; goto err1; } - n = readlink(p, resolved, MAXPATHLEN); + n = readlink(p, resolved, MAXPATHLEN - 1); if (n < 0) goto err1; resolved[n] = '\0'; diff --git a/lib/libc/stdlib/setenv.c b/lib/libc/stdlib/setenv.c index d9812771e700..4c00b6e882f3 100644 --- a/lib/libc/stdlib/setenv.c +++ b/lib/libc/stdlib/setenv.c @@ -73,7 +73,7 @@ setenv(name, value, rewrite) for (p = environ, cnt = 0; *p; ++p, ++cnt); if (alloced) { /* just increase size */ - environ = (char **)realloc((char *)environ, + environ = (char **)reallocf((char *)environ, (size_t)(sizeof(char *) * (cnt + 2))); if (!environ) return (-1); |
