aboutsummaryrefslogtreecommitdiffhomepage
path: root/signal.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-07-28 17:49:46 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-08-04 11:34:45 -0700
commit2e1b3325c63cd6c43a10a08acfc54d1fb29a5c03 (patch)
treebf02e8d37f7ea5ffe28d293ad7bd3b690cc7dae6 /signal.cpp
parent1b8f1650dc9959ace0df2037f751682e73b5bb1d (diff)
Warning cleanup
Diffstat (limited to 'signal.cpp')
-rw-r--r--signal.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/signal.cpp b/signal.cpp
index 2e132c8d..708dd38a 100644
--- a/signal.cpp
+++ b/signal.cpp
@@ -373,7 +373,7 @@ static int match_signal_name( const wchar_t *canonical,
int wcs2sig( const wchar_t *str )
{
- int i, res;
+ int i;
wchar_t *end=0;
for( i=0; lookup[i].desc ; i++ )
@@ -384,9 +384,9 @@ int wcs2sig( const wchar_t *str )
}
}
errno=0;
- res = wcstol( str, &end, 10 );
- if( !errno && res>=0 && !*end )
- return res;
+ long res = wcstol( str, &end, 10 );
+ if( !errno && res>=0 && res <= INT_MAX && !*end )
+ return (int)res;
return -1;
}