From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 72D15B612 for ; Fri, 20 Feb 2015 16:21:45 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 20 Feb 2015 07:17:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,615,1418112000"; d="scan'208";a="654853914" Received: from unknown (HELO Sent) ([10.217.248.227]) by orsmga001.jf.intel.com with SMTP; 20 Feb 2015 07:21:36 -0800 Received: by Sent (sSMTP sendmail emulation); Fri, 20 Feb 2015 17:18:10 +0100 From: Daniel Mrzyglod To: dev@dpdk.org Date: Fri, 20 Feb 2015 17:18:05 +0100 Message-Id: <1424449085-82466-1-git-send-email-danielx.t.mrzyglod@intel.com> X-Mailer: git-send-email 2.1.0 Subject: [dpdk-dev] [PATCH] cmdline: fix type format from unsigned to size_t for buffer size X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2015 15:21:46 -0000 Function match_inst is used to take buffor using sizeof() which is size_t type. This modification also involved changing '%u' to '%zu' in printf function. Signed-off-by: Daniel Mrzyglod --- lib/librte_cmdline/cmdline_parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_cmdline/cmdline_parse.c b/lib/librte_cmdline/cmdline_parse.c index dfc885c..0821791 100644 --- a/lib/librte_cmdline/cmdline_parse.c +++ b/lib/librte_cmdline/cmdline_parse.c @@ -138,7 +138,7 @@ nb_common_chars(const char * s1, const char * s2) */ static int match_inst(cmdline_parse_inst_t *inst, const char *buf, - unsigned int nb_match_token, void *resbuf, unsigned resbuf_size) + unsigned int nb_match_token, void *resbuf, size_t resbuf_size) { unsigned int token_num=0; cmdline_parse_token_hdr_t * token_p; @@ -169,7 +169,7 @@ match_inst(cmdline_parse_inst_t *inst, const char *buf, if (token_hdr.offset > resbuf_size) { printf("Parse error(%s:%d): Token offset(%u) " - "exceeds maximum size(%u)\n", + "exceeds maximum size(%zu)\n", __FILE__, __LINE__, token_hdr.offset, resbuf_size); return -ENOBUFS; -- 2.1.0