diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-03-17 00:37:31 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-03-17 00:37:31 +0000 |
commit | cf00df63443b40190d3f88c5f0a7e102540d0cac (patch) | |
tree | 2ac33f2738bad5268dbd12a084e2a3a9945704c4 /sftp-int.c | |
parent | 5df2ffaeacd5a88b144740279e310e9c373bd8df (diff) |
- markus@cvs.openbsd.org 2001/03/16 13:44:24
[sftp-int.c]
discourage strcat/strcpy
Diffstat (limited to 'sftp-int.c')
-rw-r--r-- | sftp-int.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sftp-int.c b/sftp-int.c index f77e2ebd9..8e45f869b 100644 --- a/sftp-int.c +++ b/sftp-int.c | |||
@@ -26,7 +26,7 @@ | |||
26 | /* XXX: recursive operations */ | 26 | /* XXX: recursive operations */ |
27 | 27 | ||
28 | #include "includes.h" | 28 | #include "includes.h" |
29 | RCSID("$OpenBSD: sftp-int.c,v 1.30 2001/03/16 09:55:53 markus Exp $"); | 29 | RCSID("$OpenBSD: sftp-int.c,v 1.31 2001/03/16 13:44:24 markus Exp $"); |
30 | 30 | ||
31 | #include "buffer.h" | 31 | #include "buffer.h" |
32 | #include "xmalloc.h" | 32 | #include "xmalloc.h" |
@@ -198,11 +198,12 @@ char * | |||
198 | path_append(char *p1, char *p2) | 198 | path_append(char *p1, char *p2) |
199 | { | 199 | { |
200 | char *ret; | 200 | char *ret; |
201 | int len = strlen(p1) + strlen(p2) + 2; | ||
201 | 202 | ||
202 | ret = xmalloc(strlen(p1) + strlen(p2) + 2); | 203 | ret = xmalloc(len); |
203 | strcpy(ret, p1); | 204 | strlcpy(ret, p1, len); |
204 | strcat(ret, "/"); | 205 | strlcat(ret, "/", len); |
205 | strcat(ret, p2); | 206 | strlcat(ret, p2, len); |
206 | 207 | ||
207 | return(ret); | 208 | return(ret); |
208 | } | 209 | } |