diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-01-05 06:09:52 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-01-05 06:09:52 +0000 |
commit | 8835a8910513621a4c20a0ede9a4bdeee947cbd4 (patch) | |
tree | 1cdf3c45b686371c900a80152e8ac127873f10c0 | |
parent | 91c2a985f9d00247ba2fda6aebbffaeac609f328 (diff) |
- (bal) bsd-getcwd.c and bsd-setenv.c changed from bcopy() to memmove()
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | bsd-getcwd.c | 8 | ||||
-rw-r--r-- | bsd-setenv.c | 2 |
3 files changed, 6 insertions, 5 deletions
@@ -1,5 +1,6 @@ | |||
1 | 20010105 | 1 | 20010105 |
2 | - (bal) contrib/caldera/ provided by Tim Rice <tim@multitalents.net> | 2 | - (bal) contrib/caldera/ provided by Tim Rice <tim@multitalents.net> |
3 | - (bal) bsd-getcwd.c and bsd-setenv.c changed from bcopy() to memmove() | ||
3 | 4 | ||
4 | 20010104 | 5 | 20010104 |
5 | - (djm) Fix memory leak on systems with BROKEN_GETADDRINFO. Based on | 6 | - (djm) Fix memory leak on systems with BROKEN_GETADDRINFO. Based on |
diff --git a/bsd-getcwd.c b/bsd-getcwd.c index cca417787..273a0487c 100644 --- a/bsd-getcwd.c +++ b/bsd-getcwd.c | |||
@@ -119,7 +119,7 @@ getcwd(char *pt,size_t size) | |||
119 | * path to the beginning of the buffer, but it's always | 119 | * path to the beginning of the buffer, but it's always |
120 | * been that way and stuff would probably break. | 120 | * been that way and stuff would probably break. |
121 | */ | 121 | */ |
122 | bcopy(bpt, pt, ept - bpt); | 122 | memmove(bpt, pt, ept - bpt); |
123 | free(up); | 123 | free(up); |
124 | return (pt); | 124 | return (pt); |
125 | } | 125 | } |
@@ -170,7 +170,7 @@ getcwd(char *pt,size_t size) | |||
170 | goto notfound; | 170 | goto notfound; |
171 | if (ISDOT(dp)) | 171 | if (ISDOT(dp)) |
172 | continue; | 172 | continue; |
173 | bcopy(dp->d_name, bup, dp->d_namlen + 1); | 173 | memmove(dp->d_name, bup, dp->d_namlen + 1); |
174 | 174 | ||
175 | /* Save the first error for later. */ | 175 | /* Save the first error for later. */ |
176 | if (lstat(up, &s)) { | 176 | if (lstat(up, &s)) { |
@@ -202,13 +202,13 @@ getcwd(char *pt,size_t size) | |||
202 | pt = npt; | 202 | pt = npt; |
203 | bpt = pt + off; | 203 | bpt = pt + off; |
204 | ept = pt + ptsize; | 204 | ept = pt + ptsize; |
205 | bcopy(bpt, ept - len, len); | 205 | memmove(bpt, ept - len, len); |
206 | bpt = ept - len; | 206 | bpt = ept - len; |
207 | } | 207 | } |
208 | if (!first) | 208 | if (!first) |
209 | *--bpt = '/'; | 209 | *--bpt = '/'; |
210 | bpt -= dp->d_namlen; | 210 | bpt -= dp->d_namlen; |
211 | bcopy(dp->d_name, bpt, dp->d_namlen); | 211 | memmove(dp->d_name, bpt, dp->d_namlen); |
212 | (void)closedir(dir); | 212 | (void)closedir(dir); |
213 | 213 | ||
214 | /* Truncate any file name. */ | 214 | /* Truncate any file name. */ |
diff --git a/bsd-setenv.c b/bsd-setenv.c index f5dbd2770..d69f88258 100644 --- a/bsd-setenv.c +++ b/bsd-setenv.c | |||
@@ -122,7 +122,7 @@ setenv(name, value, rewrite) | |||
122 | (cnt + 2))); | 122 | (cnt + 2))); |
123 | if (!P) | 123 | if (!P) |
124 | return (-1); | 124 | return (-1); |
125 | bcopy(environ, P, cnt * sizeof(char *)); | 125 | memmove(environ, P, cnt * sizeof(char *)); |
126 | environ = P; | 126 | environ = P; |
127 | } | 127 | } |
128 | environ[cnt + 1] = NULL; | 128 | environ[cnt + 1] = NULL; |