String field length is duplicated in two places. Make it a sizeof.
Signed-off-by: Fam Zheng <[email protected]>
---
block/curl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/curl.c b/block/curl.c
index a829fe7..a11002b 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);
--
1.8.3