incubator-celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject svn commit: r1607451 - /incubator/celix/trunk/remote_shell/private/src/activator.c
Date Wed, 02 Jul 2014 19:14:55 GMT
Author: bpetri
Date: Wed Jul  2 19:14:54 2014
New Revision: 1607451

URL: http://svn.apache.org/r1607451
Log:

CELIX-128

replaced atoi implementation with strtol.


Modified:
    incubator/celix/trunk/remote_shell/private/src/activator.c

Modified: incubator/celix/trunk/remote_shell/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_shell/private/src/activator.c?rev=1607451&r1=1607450&r2=1607451&view=diff
==============================================================================
--- incubator/celix/trunk/remote_shell/private/src/activator.c (original)
+++ incubator/celix/trunk/remote_shell/private/src/activator.c Wed Jul  2 19:14:54 2014
@@ -120,8 +120,10 @@ static apr_size_t bundleActivator_getPro
 
 	bundleContext_getProperty(context, propertyName, &strValue);
 	if (strValue != NULL) {
-		value = atoi(strValue);
-		if (errno != 0) {
+        	char* endptr = strValue;
+        	errno = 0;
+        	value = (apr_size_t) strtol(strValue, &endptr, 10);
+        	if (*endptr || errno != 0) { 
 			printf("incorrect format for %s\n", propertyName);
 			value = defaultValue;
 		}



Mime
View raw message