summaryrefslogtreecommitdiff
path: root/bsd-getcwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'bsd-getcwd.c')
-rw-r--r--bsd-getcwd.c8
1 files changed, 4 insertions, 4 deletions
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. */