提交 244048f8 authored 作者: Michael Jerris's avatar Michael Jerris

add switch_clean_name_string to strip out caller id name chars that can cause issues

上级 1f4cb488
......@@ -500,6 +500,23 @@ static inline char *switch_clean_string(char *s)
}
static inline char *switch_clean_name_string(char *s)
{
char *p;
for (p = s; p && *p; p++) {
uint8_t x = (uint8_t) * p;
if ((x < 32) || x == '\'' || x == '"' || x == '<' || x == '>' || x == '\\' || x == ':' || x == '@' || x == '/') {
*p = ' ';
}
if ( (p == s) && (*p == ' ') ) {
s++;
}
}
return s;
}
/*!
\brief Free a pointer and set it to NULL unless it already is NULL
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论