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

Function expires_parser

parser/parse_expires.c:39–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37
38
39static inline int expires_parser(char* _s, int _l, exp_body_t* _e)
40{
41 str tmp;
42
43 tmp.s = _s;
44 tmp.len = _l;
45
46 trim(&tmp);
47
48 if (tmp.len == 0) {
49 LM_ERR("empty body\n");
50 _e->valid = 0;
51 return -1;
52 }
53
54 if ( str2int( &tmp, (unsigned int*)&_e->val)!=0 ) {
55 LM_ERR("body is not a number <%.*s>\n",tmp.len,tmp.s);
56 _e->valid = 0;
57 return -2;
58 }
59
60 _e->text = tmp;
61 _e->valid = 1;
62
63 return 0;
64}
65
66
67/*

Callers 1

parse_expiresFunction · 0.85

Calls 2

trimFunction · 0.85
str2intFunction · 0.85

Tested by

no test coverage detected