| 37 | |
| 38 | |
| 39 | static 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 | /* |
no test coverage detected