summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-06-05 17:21:37 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-06-05 17:21:37 +0000
commitcee5187a0a8f7a78dccba2e3885548689966ad37 (patch)
treec90b18b4086f28a9974d502a36eb9ebb05937cae /lib
parent28e7ba32015fef1cbed131a2f1118457c42f8d75 (diff)
snprintf
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/db/hash/ndbm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libc/db/hash/ndbm.c b/lib/libc/db/hash/ndbm.c
index e6f3dad6ac9..c0db9cd225f 100644
--- a/lib/libc/db/hash/ndbm.c
+++ b/lib/libc/db/hash/ndbm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ndbm.c,v 1.13 2002/02/16 21:27:22 millert Exp $ */
+/* $OpenBSD: ndbm.c,v 1.14 2002/06/05 17:21:36 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -40,7 +40,7 @@
#if 0
static char sccsid[] = "@(#)dbm.c 8.6 (Berkeley) 11/7/95";
#else
-static char rcsid[] = "$OpenBSD: ndbm.c,v 1.13 2002/02/16 21:27:22 millert Exp $";
+static char rcsid[] = "$OpenBSD: ndbm.c,v 1.14 2002/06/05 17:21:36 deraadt Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -215,8 +215,7 @@ _dbm_open(file, suff, flags, mode)
info.cachesize = 0;
info.hash = NULL;
info.lorder = 0;
- (void)strcpy(path, file);
- (void)strcat(path, suff);
+ snprintf(path, sizeof path, "%s%s", file, suff);
return ((DBM *)__hash_open(path, flags, mode, &info, 0));
}