All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] module: fix sprintf format specifier in param_get_byte()
@ 2013-08-06 21:12 Christoph Jaeger
  2013-08-06 23:39 ` Joe Perches
  2013-08-07  6:43 ` Rusty Russell
  0 siblings, 2 replies; 5+ messages in thread
From: Christoph Jaeger @ 2013-08-06 21:12 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel, Christoph Jaeger

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-08-07 16:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-06 21:12 [PATCH 1/1] module: fix sprintf format specifier in param_get_byte() Christoph Jaeger
2013-08-06 23:39 ` Joe Perches
2013-08-07  6:43 ` Rusty Russell
2013-08-07 11:31   ` Michal Nazarewicz
2013-08-07 16:45   ` Jon Mason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.