File tree 2 files changed +2
-13
lines changed
2 files changed +2
-13
lines changed Original file line number Diff line number Diff line change 47
47
* define characters that should be skipped
48
48
* here.
49
49
*/
50
- #define TRIM_SWITCH (c ) switch(c) { \
51
- case ' ': \
52
- case '\t': \
53
- case '\r': \
54
- case '\n': \
55
- break; \
56
- \
57
- default: \
58
- return; \
59
- }
60
-
50
+ #define TRIM_SWITCH (c ) {if (!is_ws(c)) return;}
61
51
62
52
/*! \brief
63
53
* Remove any leading whitechars, like spaces,
Original file line number Diff line number Diff line change @@ -63,8 +63,7 @@ struct sip_msg;
63
63
#define trim_len ( _len , _begin , _mystr ) \
64
64
do{ static char _c; \
65
65
(_len)=(_mystr).len; \
66
- while ((_len) && ((_c=(_mystr).s[(_len)-1])==0 || _c=='\r' || \
67
- _c=='\n' || _c==' ' || _c=='\t' )) \
66
+ while ((_len) && ((_c=(_mystr).s[(_len)-1])==0 || is_ws(_c))) \
68
67
(_len)--; \
69
68
(_begin)=(_mystr).s; \
70
69
while ((_len) && ((_c=*(_begin))==' ' || _c=='\t')) { \
You can’t perform that action at this time.
0 commit comments