diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | openbsd-compat/getcwd.c | 8 | ||||
-rw-r--r-- | openbsd-compat/setenv.c | 2 |
3 files changed, 10 insertions, 6 deletions
@@ -1,3 +1,7 @@ | |||
1 | 20010220 | ||
2 | - (bal) Fix mixed up params to memmove() from Jan 5th in setenv.c and | ||
3 | getcwd.c. | ||
4 | |||
1 | 20010219 | 5 | 20010219 |
2 | - (bal) Markus' blessing to rename login.[ch] -> sshlogin.[ch] and | 6 | - (bal) Markus' blessing to rename login.[ch] -> sshlogin.[ch] and |
3 | pty.[ch] -> sshpty.[ch] | 7 | pty.[ch] -> sshpty.[ch] |
@@ -4070,4 +4074,4 @@ | |||
4070 | - Wrote replacements for strlcpy and mkdtemp | 4074 | - Wrote replacements for strlcpy and mkdtemp |
4071 | - Released 1.0pre1 | 4075 | - Released 1.0pre1 |
4072 | 4076 | ||
4073 | $Id: ChangeLog,v 1.803 2001/02/19 10:51:49 djm Exp $ | 4077 | $Id: ChangeLog,v 1.804 2001/02/19 19:54:43 mouring Exp $ |
diff --git a/openbsd-compat/getcwd.c b/openbsd-compat/getcwd.c index 273a0487c..de3baccbb 100644 --- a/openbsd-compat/getcwd.c +++ b/openbsd-compat/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 | memmove(bpt, pt, ept - bpt); | 122 | memmove(pt, bpt, 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 | memmove(dp->d_name, bup, dp->d_namlen + 1); | 173 | memmove(bup, dp->d_name, 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 | memmove(bpt, ept - len, len); | 205 | memmove(ept - len, bpt, 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 | memmove(dp->d_name, bpt, dp->d_namlen); | 211 | memmove(bpt, dp->d_name, 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/openbsd-compat/setenv.c b/openbsd-compat/setenv.c index d69f88258..ac9670baf 100644 --- a/openbsd-compat/setenv.c +++ b/openbsd-compat/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 | memmove(environ, P, cnt * sizeof(char *)); | 125 | memmove(P, environ, cnt * sizeof(char *)); |
126 | environ = P; | 126 | environ = P; |
127 | } | 127 | } |
128 | environ[cnt + 1] = NULL; | 128 | environ[cnt + 1] = NULL; |