summaryrefslogtreecommitdiffstats
path: root/src/plugins/kdb/db2/libdb2
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/kdb/db2/libdb2')
-rw-r--r--src/plugins/kdb/db2/libdb2/test/dbtest.c2
-rw-r--r--src/plugins/kdb/db2/libdb2/test/hash1.tests/driver2.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/kdb/db2/libdb2/test/dbtest.c b/src/plugins/kdb/db2/libdb2/test/dbtest.c
index d479f1967..b0aee708d 100644
--- a/src/plugins/kdb/db2/libdb2/test/dbtest.c
+++ b/src/plugins/kdb/db2/libdb2/test/dbtest.c
@@ -163,7 +163,7 @@ main(argc, argv)
p = getenv("TMPDIR");
if (p == NULL)
p = "/var/tmp";
- (void)sprintf(buf, "%s/__dbtest", p);
+ (void)snprintf(buf, sizeof(buf), "%s/__dbtest", p);
fname = buf;
(void)unlink(buf);
} else if (!sflag)
diff --git a/src/plugins/kdb/db2/libdb2/test/hash1.tests/driver2.c b/src/plugins/kdb/db2/libdb2/test/hash1.tests/driver2.c
index 6a3b432cb..34397ecaa 100644
--- a/src/plugins/kdb/db2/libdb2/test/hash1.tests/driver2.c
+++ b/src/plugins/kdb/db2/libdb2/test/hash1.tests/driver2.c
@@ -82,7 +82,7 @@ main(argc, argv)
#endif
info.lorder = 0;
if (!(db = dbopen("bigtest", O_RDWR | O_CREAT | O_BINARY, 0644, DB_HASH, &info))) {
- sprintf(buf, "dbopen: failed on file bigtest");
+ snprintf(buf, sizeof(buf), "dbopen: failed on file bigtest");
perror(buf);
exit(1);
}
@@ -96,10 +96,10 @@ main(argc, argv)
content.size = 128 + (rand()&1023);
/* printf("%d: Key size %d, data size %d\n", i, key.size,
content.size); */
- sprintf(keybuf, "Key #%d", i);
- sprintf(contentbuf, "Contents #%d", i);
+ snprintf(keybuf, sizeof(keybuf), "Key #%d", i);
+ snprintf(contentbuf, sizeof(contentbuf), "Contents #%d", i);
if ((db->put)(db, &key, &content, R_NOOVERWRITE)) {
- sprintf(buf, "dbm_store #%d", i);
+ snprintf(buf, sizeof(buf), "dbm_store #%d", i);
perror(buf);
}
}