summaryrefslogtreecommitdiff
path: root/sftp-int.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-03-17 00:37:31 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-03-17 00:37:31 +0000
commitcf00df63443b40190d3f88c5f0a7e102540d0cac (patch)
tree2ac33f2738bad5268dbd12a084e2a3a9945704c4 /sftp-int.c
parent5df2ffaeacd5a88b144740279e310e9c373bd8df (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.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sftp-int.c b/sftp-int.c
index f77e2ebd..8e45f869 100644
--- a/sftp-int.c
+++ b/sftp-int.c
@@ -26,7 +26,7 @@
/* XXX: recursive operations */
#include "includes.h"
-RCSID("$OpenBSD: sftp-int.c,v 1.30 2001/03/16 09:55:53 markus Exp $");
+RCSID("$OpenBSD: sftp-int.c,v 1.31 2001/03/16 13:44:24 markus Exp $");
#include "buffer.h"
#include "xmalloc.h"
@@ -198,11 +198,12 @@ char *
path_append(char *p1, char *p2)
{
char *ret;
+ int len = strlen(p1) + strlen(p2) + 2;
- ret = xmalloc(strlen(p1) + strlen(p2) + 2);
- strcpy(ret, p1);
- strcat(ret, "/");
- strcat(ret, p2);
+ ret = xmalloc(len);
+ strlcpy(ret, p1, len);
+ strlcat(ret, "/", len);
+ strlcat(ret, p2, len);
return(ret);
}