DPDK patches and discussions
 help / color / mirror / Atom feed
From: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] cmdline: fix type format from unsigned to size_t for buffer size
Date: Fri, 20 Feb 2015 17:18:05 +0100	[thread overview]
Message-ID: <1424449085-82466-1-git-send-email-danielx.t.mrzyglod@intel.com> (raw)

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 <danielx.t.mrzyglod@intel.com>
---
 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

             reply	other threads:[~2015-02-20 15:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20 16:18 Daniel Mrzyglod [this message]
2015-02-24 11:03 ` Olivier MATZ
2015-03-23 11:46   ` Thomas Monjalon
2015-03-24 10:48     ` Jastrzebski, MichalX K
2015-03-24 11:19       ` Olivier MATZ

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1424449085-82466-1-git-send-email-danielx.t.mrzyglod@intel.com \
    --to=danielx.t.mrzyglod@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).