src/server/util/util.c

changeset 119
155cbab9eefd
parent 118
38bf6dd8f4e7
child 127
84e206063b64
equal deleted inserted replaced
118:38bf6dd8f4e7 119:155cbab9eefd
377 } 377 }
378 if(s.ptr[0] == 'F' || s.ptr[0] == 'f') { 378 if(s.ptr[0] == 'F' || s.ptr[0] == 'f') {
379 return 0; 379 return 0;
380 } 380 }
381 return def; 381 return def;
382 }
383
384 NSAPI_PUBLIC int util_strtoint(char *str, int64_t *value) {
385 char *end;
386 errno = 0;
387 int64_t val = strtoll(str, &end, 0);
388 if(errno == 0) {
389 *value = val;
390 return 1;
391 } else {
392 return 0;
393 }
382 } 394 }
383 395
384 396
385 /* ------------------------------ util_itoa ------------------------------- */ 397 /* ------------------------------ util_itoa ------------------------------- */
386 /* 398 /*

mercurial