From: Christoph Jaeger <christophjaeger@linux.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-kernel@vger.kernel.org,
Christoph Jaeger <christophjaeger@linux.com>
Subject: [PATCH 1/1] module: fix sprintf format specifier in param_get_byte()
Date: Tue, 6 Aug 2013 23:12:12 +0200 [thread overview]
Message-ID: <1375823532-24153-1-git-send-email-christophjaeger@linux.com> (raw)
In param_get_byte(), to which the macro STANDARD_PARAM_DEF(byte, ...) expands,
"%c" is used to print an unsigned char. So it gets printed as a character what
is not intended here. Use "%hhu" instead.
Signed-off-by: Christoph Jaeger <christophjaeger@linux.com>
---
kernel/params.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/params.c b/kernel/params.c
index 440e65d..59f7ac7 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -252,7 +252,7 @@ int parse_args(const char *doing,
EXPORT_SYMBOL(param_ops_##name)
-STANDARD_PARAM_DEF(byte, unsigned char, "%c", unsigned long, strict_strtoul);
+STANDARD_PARAM_DEF(byte, unsigned char, "%hhu", unsigned long, strict_strtoul);
STANDARD_PARAM_DEF(short, short, "%hi", long, strict_strtol);
STANDARD_PARAM_DEF(ushort, unsigned short, "%hu", unsigned long, strict_strtoul);
STANDARD_PARAM_DEF(int, int, "%i", long, strict_strtol);
--
1.8.3.1
next reply other threads:[~2013-08-06 21:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-06 21:12 Christoph Jaeger [this message]
2013-08-06 23:39 ` [PATCH 1/1] module: fix sprintf format specifier in param_get_byte() Joe Perches
2013-08-07 6:43 ` Rusty Russell
2013-08-07 11:31 ` Michal Nazarewicz
2013-08-07 16:45 ` Jon Mason
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=1375823532-24153-1-git-send-email-christophjaeger@linux.com \
--to=christophjaeger@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/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