Skip to content

Commit 659b329

Browse files
committed
Use is_ws() in two more places where appropriate.
1 parent 156460e commit 659b329

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

trim.h

+1-11
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,7 @@
4747
* define characters that should be skipped
4848
* here.
4949
*/
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;}
6151

6252
/*! \brief
6353
* Remove any leading whitechars, like spaces,

ut.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ struct sip_msg;
6363
#define trim_len( _len, _begin, _mystr ) \
6464
do{ static char _c; \
6565
(_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))) \
6867
(_len)--; \
6968
(_begin)=(_mystr).s; \
7069
while ((_len) && ((_c=*(_begin))==' ' || _c=='\t')) { \

0 commit comments

Comments
 (0)