X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/185aa5b0e5f5ffd4d5ca442bdff113aba501f19b..83078af5b0b1db4eb185cb256ebb76c117eea110:/util.c 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]; } }