summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--openbsd-compat/getcwd.c8
-rw-r--r--openbsd-compat/setenv.c2
3 files changed, 10 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 80f66216..aa4af256 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+20010220
+ - (bal) Fix mixed up params to memmove() from Jan 5th in setenv.c and
+ getcwd.c.
+
20010219
- (bal) Markus' blessing to rename login.[ch] -> sshlogin.[ch] and
pty.[ch] -> sshpty.[ch]
@@ -4070,4 +4074,4 @@
- Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1
-$Id: ChangeLog,v 1.803 2001/02/19 10:51:49 djm Exp $
+$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 273a0487..de3baccb 100644
--- a/openbsd-compat/getcwd.c
+++ b/openbsd-compat/getcwd.c
@@ -119,7 +119,7 @@ getcwd(char *pt,size_t size)
* path to the beginning of the buffer, but it's always
* been that way and stuff would probably break.
*/
- memmove(bpt, pt, ept - bpt);
+ memmove(pt, bpt, ept - bpt);
free(up);
return (pt);
}
@@ -170,7 +170,7 @@ getcwd(char *pt,size_t size)
goto notfound;
if (ISDOT(dp))
continue;
- memmove(dp->d_name, bup, dp->d_namlen + 1);
+ memmove(bup, dp->d_name, dp->d_namlen + 1);
/* Save the first error for later. */
if (lstat(up, &s)) {
@@ -202,13 +202,13 @@ getcwd(char *pt,size_t size)
pt = npt;
bpt = pt + off;
ept = pt + ptsize;
- memmove(bpt, ept - len, len);
+ memmove(ept - len, bpt, len);
bpt = ept - len;
}
if (!first)
*--bpt = '/';
bpt -= dp->d_namlen;
- memmove(dp->d_name, bpt, dp->d_namlen);
+ memmove(bpt, dp->d_name, dp->d_namlen);
(void)closedir(dir);
/* Truncate any file name. */
diff --git a/openbsd-compat/setenv.c b/openbsd-compat/setenv.c
index d69f8825..ac9670ba 100644
--- a/openbsd-compat/setenv.c
+++ b/openbsd-compat/setenv.c
@@ -122,7 +122,7 @@ setenv(name, value, rewrite)
(cnt + 2)));
if (!P)
return (-1);
- memmove(environ, P, cnt * sizeof(char *));
+ memmove(P, environ, cnt * sizeof(char *));
environ = P;
}
environ[cnt + 1] = NULL;