lkml.org 
[lkml]   [2008]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] lib/vsprintf.c: wrong conversion function used
Date
From: Swen Schillig <swen@vnet.ibm.com>

The macro define_strict_strtoux() is using the simple_strtoul ()
function as opposed to the simple_strtoull() function.
This leads to false conversions on non-64bit
machines (here 31bit System z).

The following patch fixes the issue introduced by

commit 06b2a76d25d3cfbd14680021c1d356c91be6904e
Author: Yi Yang <yi.y.yang@intel.com>
Date: Fri Feb 8 04:21:57 2008 -0800

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
---
lib/vsprintf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: HEAD/lib/vsprintf.c
===================================================================
--- HEAD.orig/lib/vsprintf.c
+++ HEAD/lib/vsprintf.c
@@ -220,7 +220,7 @@ int strict_strtou##type(const char *cp,
if (len == 0) \
return -EINVAL; \
\
- val = simple_strtoul(cp, &tail, base); \
+ val = simple_strtoull(cp, &tail, base); \
if ((*tail == '\0') || \
((len == (size_t)(tail - cp) + 1) && (*tail == '\n'))) {\
*res = val; \

\
 
 \ /
  Last update: 2008-08-07 14:39    [W:0.174 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site