547:280bf87c8689 | 548:40ecc0a6b280 |
---|---|
429 | 429 |
430 NSAPI_PUBLIC int util_strtoint(const char *str, int64_t *value) { | 430 NSAPI_PUBLIC int util_strtoint(const char *str, int64_t *value) { |
431 char *end; | 431 char *end; |
432 errno = 0; | 432 errno = 0; |
433 int64_t val = strtoll(str, &end, 0); | 433 int64_t val = strtoll(str, &end, 0); |
434 if(errno == 0) { | 434 if(errno == 0 && *end == '\0') { |
435 *value = val; | 435 *value = val; |
436 return 1; | 436 return 1; |
437 } else { | 437 } else { |
438 return 0; | 438 return 0; |
439 } | 439 } |