summaryrefslogtreecommitdiff
path: root/lib/replace/test
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-10-22 14:41:47 +0200
committerStefan Metzmacher <metze@samba.org>2010-10-23 08:49:29 +0200
commit96601cab1cb0bd47051cd9fb30f0464c0734cb8a (patch)
treeccea55c0b9e96b6cfc100a115b0e53b77cae6d74 /lib/replace/test
parentd65896cc3c5e67508e295e6d64193210e958971c (diff)
downloadsamba-96601cab1cb0bd47051cd9fb30f0464c0734cb8a.tar.gz
samba-96601cab1cb0bd47051cd9fb30f0464c0734cb8a.tar.bz2
samba-96601cab1cb0bd47051cd9fb30f0464c0734cb8a.zip
lib/replace: use snprintf() in test code to avoid warnings in the IBM-Checker
metze
Diffstat (limited to 'lib/replace/test')
-rw-r--r--lib/replace/test/os2_delete.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/replace/test/os2_delete.c b/lib/replace/test/os2_delete.c
index 8b52837018..9d760bfdc2 100644
--- a/lib/replace/test/os2_delete.c
+++ b/lib/replace/test/os2_delete.c
@@ -46,7 +46,7 @@ static void create_files(void)
for (i=0;i<NUM_FILES;i++) {
char fname[40];
int fd;
- sprintf(fname, TESTDIR "/test%u.txt", i);
+ snprintf(fname, sizeof(fname), TESTDIR "/test%u.txt", i);
fd = open(fname, O_CREAT|O_RDWR, 0600);
if (fd < 0) {
FAILED("open");
@@ -79,7 +79,7 @@ static int os2_delete(DIR *d)
/* delete the first few */
for (j=0; j<MIN(i, DELETE_SIZE); j++) {
char fname[40];
- sprintf(fname, TESTDIR "/%s", names[j]);
+ snprintf(fname, sizeof(fname), TESTDIR "/%s", names[j]);
unlink(fname) == 0 || FAILED("unlink");
}