don't format non numbers

This commit is contained in:
Michael Jerris 2011-11-21 13:31:19 -05:00
parent a24148db71
commit d66d41232b
1 changed files with 14 additions and 3 deletions

View File

@ -2893,10 +2893,22 @@ SWITCH_DECLARE(char *) switch_format_number(const char *num)
size_t len;
const char *p = num;
if(*p == '+') {
if (!p) {
return p;
}
if (zstr(p)) {
return strdup(p);
}
if (*p == '+') {
p++;
}
if (!switch_is_number(p)) {
return strdup(p);
}
len = strlen(p);
/* region 1, TBD add more....*/
@ -2908,7 +2920,6 @@ SWITCH_DECLARE(char *) switch_format_number(const char *num)
r = strdup(num);
}
return r;
}