mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 12:40:17 +00:00
FS-11183 improve strip to save out buffer size
This commit is contained in:
parent
2cb4e49432
commit
868e92649e
@ -1405,12 +1405,12 @@ SWITCH_DECLARE(char *) switch_strip_commas(char *in, char *out, switch_size_t le
|
||||
for (; p && *p; p++) {
|
||||
if ((*p > 47 && *p < 58)) {
|
||||
*q++ = *p;
|
||||
} else if (*p != ',') {
|
||||
|
||||
if (++x > len) {
|
||||
ret = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
if (++x > len) {
|
||||
} else if (*p != ',') {
|
||||
ret = NULL;
|
||||
break;
|
||||
}
|
||||
@ -1428,13 +1428,13 @@ SWITCH_DECLARE(char *) switch_strip_nonnumerics(char *in, char *out, switch_size
|
||||
for (; p && *p; p++) {
|
||||
if ((*p > 47 && *p < 58) || *p == '.' || *p == '-' || *p == '+') {
|
||||
*q++ = *p;
|
||||
}
|
||||
|
||||
if (++x > len) {
|
||||
ret = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user