MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / str2int

Function str2int

ut.h:720–738  ·  view source on GitHub ↗

* Convert a str into integer */

Source from the content-addressed store, hash-verified

718 * Convert a str into integer
719 */
720static inline int str2int(const str* _s, unsigned int* _r)
721{
722 int i;
723
724 if (_s==0 || _s->s == 0 || _s->len == 0 || _r == 0)
725 return -1;
726
727 *_r = 0;
728 for(i = 0; i < _s->len; i++) {
729 if ((_s->s[i] >= '0') && (_s->s[i] <= '9')) {
730 *_r *= 10;
731 *_r += _s->s[i] - '0';
732 } else {
733 return -1;
734 }
735 }
736
737 return 0;
738}
739
740/*
741 * Convert a str into a big integer

Callers 15

strno2intFunction · 0.85
route_param_getFunction · 0.85
mk_net_cidrFunction · 0.85
parse_phostportFunction · 0.85
pv_get_return_valueFunction · 0.85
pv_parse_param_nameFunction · 0.85
pv_parse_return_valueFunction · 0.85
tr_eval_ipFunction · 0.85
parse_reply_codesFunction · 0.85
parse_ip_netFunction · 0.85
mi_bl_get_ruleFunction · 0.85
tlsp_set_verifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected