diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-10-27 05:53:07 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-10-27 05:53:07 +0000 |
commit | bc62f8e983e913c8a37f3412466b8bc9d360b614 (patch) | |
tree | 250a926a93cfb511368c69c3c152bb8744097d98 /src/or/rephist.c | |
parent | 7d4854301c719e71bd94be5eaec732a9b1e74c0d (diff) | |
download | tor-bc62f8e983e913c8a37f3412466b8bc9d360b614.tar.gz tor-bc62f8e983e913c8a37f3412466b8bc9d360b614.zip |
Replace sprintf with snprintf
svn:r2602
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r-- | src/or/rephist.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c index 6838ceaf10..b87217280d 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -528,7 +528,7 @@ char *rep_hist_get_bandwidth_lines(void) for (r=0;r<2;++r) { b = r?read_array:write_array; format_iso_time(t, b->next_period-NUM_SECS_BW_SUM_INTERVAL); - sprintf(cp, "opt %s %s (%d s) ", r?"read-history ":"write-history", t, + snprintf(cp, len-(cp-buf), "opt %s %s (%d s) ", r?"read-history ":"write-history", t, NUM_SECS_BW_SUM_INTERVAL); cp += strlen(cp); @@ -543,9 +543,9 @@ char *rep_hist_get_bandwidth_lines(void) for (n=0; n<b->num_maxes_set; ++n,++i) { while (i >= NUM_TOTALS) i -= NUM_TOTALS; if (n==(b->num_maxes_set-1)) - sprintf(cp, "%d", b->totals[i]); + snprintf(cp, len-(cp-buf), "%d", b->totals[i]); else - sprintf(cp, "%d,", b->totals[i]); + snprintf(cp, len-(cp-buf), "%d,", b->totals[i]); cp += strlen(cp); } strcat(cp, "\n"); |