From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34213) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UezY1-0006wU-M7 for qemu-devel@nongnu.org; Tue, 21 May 2013 23:17:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UezXv-0007k4-7U for qemu-devel@nongnu.org; Tue, 21 May 2013 23:17:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64730) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UezXv-0007jo-0E for qemu-devel@nongnu.org; Tue, 21 May 2013 23:16:59 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4M3Gwkg019381 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 21 May 2013 23:16:58 -0400 Received: from localhost.nay.redhat.com ([10.66.7.14]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r4M3GqNk024814 for ; Tue, 21 May 2013 23:16:57 -0400 From: Fam Zheng Date: Wed, 22 May 2013 11:16:42 +0800 Message-Id: <1369192610-25003-3-git-send-email-famz@redhat.com> In-Reply-To: <1369192610-25003-1-git-send-email-famz@redhat.com> References: <1369192610-25003-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v4 02/10] curl: change magic number to sizeof List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org String field length is duplicated in two places. Make it a sizeof. Signed-off-by: Fam Zheng --- block/curl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 1.8.2.3