MCPcopy Create free account
hub / github.com/cppla/ServerStatus / parse_int

Function parse_int

server/src/system.c:709–732  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

707}
708
709static int parse_int(int *out, const char **str)
710{
711 int i = 0;
712 *out = 0;
713 if(**str < '0' || **str > '9')
714 return -1;
715
716 i = **str - '0';
717 (*str)++;
718
719 while(1)
720 {
721 if(**str < '0' || **str > '9')
722 {
723 *out = i;
724 return 0;
725 }
726
727 i = (i*10) + (**str - '0');
728 (*str)++;
729 }
730
731 return 0;
732}
733
734static int parse_char(char c, const char **str)
735{

Callers 2

parse_uint8Function · 0.85
parse_uint16Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected