summaryrefslogtreecommitdiffstats
path: root/libexec/tradcpp/files.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-01-17 05:31:29 +0000
committerderaadt <deraadt@openbsd.org>2015-01-17 05:31:29 +0000
commit2fbb987bd63ae720fed1fbf320a3ed9498a8fe65 (patch)
treee334dc4ae100e1ec4d48acd1132049452bedf57a /libexec/tradcpp/files.c
parentresume_randomness() before spinning up other cpus... (diff)
downloadwireguard-openbsd-2fbb987bd63ae720fed1fbf320a3ed9498a8fe65.tar.xz
wireguard-openbsd-2fbb987bd63ae720fed1fbf320a3ed9498a8fe65.zip
eliminate strcpy & strcat, by using strlcpy, strlcat or snprintf where
suitable. ok jsg
Diffstat (limited to 'libexec/tradcpp/files.c')
-rw-r--r--libexec/tradcpp/files.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/libexec/tradcpp/files.c b/libexec/tradcpp/files.c
index ea151b23286..e5e945581bb 100644
--- a/libexec/tradcpp/files.c
+++ b/libexec/tradcpp/files.c
@@ -313,11 +313,7 @@ mkfilename(struct place *place, const char *dir, const char *file)
rlen = dlen + (needslash ? 1 : 0) + flen;
ret = domalloc(rlen + 1);
- strcpy(ret, dir);
- if (needslash) {
- strcat(ret, "/");
- }
- strcat(ret, file);
+ snprintf(ret, rlen+1, "%s%s%s", dir, needslash ? "/" : "", file);
return ret;
}