aboutsummaryrefslogtreecommitdiffstats
path: root/uidlist.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2006-10-13 23:35:53 +0000
committerWayne Davison <wayned@samba.org>2006-10-13 23:35:53 +0000
commit10944395bfc989fc21fb385eb652cc274aa78a0a (patch)
tree4c5059c33909c82ab1613dd8715f66f3c7d428b5 /uidlist.c
parent204f4f4d091890d9106e744cffb9561e82df44ad (diff)
downloadandroid_external_rsync-10944395bfc989fc21fb385eb652cc274aa78a0a.tar.gz
android_external_rsync-10944395bfc989fc21fb385eb652cc274aa78a0a.tar.bz2
android_external_rsync-10944395bfc989fc21fb385eb652cc274aa78a0a.zip
Changed sprintf() calls to snprintf() calls.
Diffstat (limited to 'uidlist.c')
-rw-r--r--uidlist.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/uidlist.c b/uidlist.c
index 13f54d6c..83eee454 100644
--- a/uidlist.c
+++ b/uidlist.c
@@ -126,12 +126,10 @@ static int is_in_group(gid_t gid)
char *gidbuf = new_array(char, ngroups*21+32);
if (!gidbuf)
out_of_memory("is_in_group");
- sprintf(gidbuf, "process has %d gid%s: ",
- ngroups, ngroups == 1? "" : "s");
- pos = strlen(gidbuf);
+ pos = snprintf(gidbuf, 32, "process has %d gid%s: ",
+ ngroups, ngroups == 1? "" : "s");
for (n = 0; n < ngroups; n++) {
- sprintf(gidbuf+pos, " %d", (int)gidset[n]);
- pos += strlen(gidbuf+pos);
+ pos += snprintf(gidbuf+pos, 21, " %d", (int)gidset[n]);
}
rprintf(FINFO, "%s\n", gidbuf);
free(gidbuf);