summaryrefslogtreecommitdiff
path: root/openbsd-compat/getcwd.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-02-19 19:54:43 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-02-19 19:54:43 +0000
commit4ffaad8c33eea799dc843f5b07cca7c433ea0b6d (patch)
treebc0ad6a6e965fc0603c564f2179f0fa8aea53cdc /openbsd-compat/getcwd.c
parent7387fdb6b58b8ba26e1ec7f476d2a5b57236bae1 (diff)
- (bal) Fix mixed up params to memmove() from Jan 5th in setenv.c and
getcwd.c.
Diffstat (limited to 'openbsd-compat/getcwd.c')
-rw-r--r--openbsd-compat/getcwd.c8
1 files changed, 4 insertions, 4 deletions
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. */