aboutsummaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2006-10-13 23:46:32 +0000
committerWayne Davison <wayned@samba.org>2006-10-13 23:46:32 +0000
commit83078af5b0b1db4eb185cb256ebb76c117eea110 (patch)
tree42a4a8040cdc7cb9883064e1548d6f7565e639d4 /util.c
parent185aa5b0e5f5ffd4d5ca442bdff113aba501f19b (diff)
downloadandroid_external_rsync-83078af5b0b1db4eb185cb256ebb76c117eea110.tar.gz
android_external_rsync-83078af5b0b1db4eb185cb256ebb76c117eea110.tar.bz2
android_external_rsync-83078af5b0b1db4eb185cb256ebb76c117eea110.zip
Changed sprintf() calls to snprintf().
Diffstat (limited to 'util.c')
-rw-r--r--util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util.c b/util.c
index f32d881a..0887e7fc 100644
--- a/util.c
+++ b/util.c
@@ -359,7 +359,7 @@ int robust_unlink(const char *fname)
/* start where the last one left off to reduce chance of clashes */
start = counter;
do {
- sprintf(&path[pos], "%03d", counter);
+ snprintf(&path[pos], 4, "%03d", counter);
if (++counter >= MAX_RENAMES)
counter = 1;
} while ((rc = access(path, 0)) == 0 && counter != start);
@@ -1115,7 +1115,7 @@ char *human_num(int64 num)
units = 'K';
}
if (units) {
- sprintf(bufs[n], "%.2f%c", dnum, units);
+ snprintf(bufs[n], sizeof bufs[0], "%.2f%c", dnum, units);
return bufs[n];
}
}