source: azure_iot_hub/trunk/musl-1.1.18/src/stdlib/atoi.c@ 388

Last change on this file since 388 was 388, checked in by coas-nagasima, 5 years ago

Azure IoT Hub Device C SDK を使ったサンプルの追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-csrc
File size: 300 bytes
Line 
1#include <stdlib.h>
2#include <ctype.h>
3
4int atoi(const char *s)
5{
6 int n=0, neg=0;
7 while (isspace(*s)) s++;
8 switch (*s) {
9 case '-': neg=1;
10 case '+': s++;
11 }
12 /* Compute n as a negative number to avoid overflow on INT_MIN */
13 while (isdigit(*s))
14 n = 10*n - (*s++ - '0');
15 return neg ? n : -n;
16}
Note: See TracBrowser for help on using the repository browser.