drivers: isdn: capi: use simple_strtol to convert numbers
Subsystems (2)
PATCH 1/1 drivers: isdn: capi: use simple_strtol to convert numbers
Signed-off-by Andy Shevchenko <[email protected]>
Cc Karsten Keil <[email protected]>
Cc Tilman Schmidt <[email protected]>
--- drivers/isdn/capi/capidrv.c | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-)
drivers/isdn/capi/capidrv.c +13 -4
@@ -1515,8 +1515,13 @@ static int decodeFVteln(char *teln, unsigned long *bmaskp, int *activep)while (*s) {int digit1 =0 ;int digit2 =0 ; -if (!isdigit (*s))return -3 ; -while (isdigit (*s)) { digit1 = digit1*10 + (*s -'0' ); s++; } +char *endp; + + digit1 =simple_strtoul (s, &endp,10 ); +if (s == endp) +return -3 ; + s = endp; +if (digit1 <=0 || digit1 >30 )return -4 ;if (*s ==0 || *s ==',' || *s ==' ' ) { bmask |= (1 << digit1);
@@ -1526,8 +1531,12 @@ static int decodeFVteln(char *teln, unsigned long *bmaskp, int *activep) }if (*s !='-' )return -5 ; s++; -if (!isdigit (*s))return -3 ; -while (isdigit (*s)) { digit2 = digit2*10 + (*s -'0' ); s++; } + + digit2 =simple_strtoul (s, &endp,10 ); +if (s == endp) +return -3 ; + s = endp; +if (digit2 <=0 || digit2 >30 )return -4 ;if (*s ==0 || *s ==',' || *s ==' ' ) {if (digit1 > digit2)
Signature · 1 line
1.7.2.2
From: Andy Shevchenko <[email protected]>
Date: Tue, 7 Sep 2010 18:14:30 +0300
Quoted 1 line
Signed-off-by Andy Shevchenko <[email protected]>
Applied, thank you.