Message ID | 1369280289-20928-3-git-send-email-famz@redhat.com |
---|---|
State | New |
Headers | show |
diff --git a/block/curl.c b/block/curl.c index 2e42cd1..d0bc66f 100644 --- a/block/curl.c +++ b/block/curl.c @@ -569,7 +569,7 @@ static void curl_readv_bh_cb(void *p) state->orig_buf = g_malloc(state->buf_len); state->acb[0] = acb; - snprintf(state->range, 127, "%zd-%zd", start, end); + snprintf(state->range, sizeof(state->range) - 1, "%zd-%zd", start, end); DPRINTF("CURL (AIO): Reading %d at %zd (%s)\n", (acb->nb_sectors * SECTOR_SIZE), start, state->range); curl_easy_setopt(state->curl, CURLOPT_RANGE, state->range);
String field length is duplicated in two places. Make it a sizeof. Signed-off-by: Fam Zheng <famz@redhat.com> --- block/curl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)