提交 dbaf4992 authored 作者: Michael Jerris's avatar Michael Jerris

remove unnecessary null check, we would have crashed already if that strdup failed

上级 5c07c3eb
...@@ -243,9 +243,7 @@ static switch_status_t de_say_time(switch_core_session_t *session, char *tosay, ...@@ -243,9 +243,7 @@ static switch_status_t de_say_time(switch_core_session_t *session, char *tosay,
if ((p = strchr(tme, ':'))) { if ((p = strchr(tme, ':'))) {
*p++ = '\0'; *p++ = '\0';
minutes = atoi(p); minutes = atoi(p);
if (tme) { hours = atoi(tme);
hours = atoi(tme);
}
} else { } else {
minutes = atoi(tme); minutes = atoi(tme);
} }
......
...@@ -208,9 +208,7 @@ static switch_status_t en_say_time(switch_say_file_handle_t *sh, char *tosay, sw ...@@ -208,9 +208,7 @@ static switch_status_t en_say_time(switch_say_file_handle_t *sh, char *tosay, sw
if ((p = strchr(tme, ':'))) { if ((p = strchr(tme, ':'))) {
*p++ = '\0'; *p++ = '\0';
minutes = atoi(p); minutes = atoi(p);
if (tme) { hours = atoi(tme);
hours = atoi(tme);
}
} else { } else {
minutes = atoi(tme); minutes = atoi(tme);
} }
......
...@@ -237,9 +237,7 @@ static switch_status_t es_say_time(switch_core_session_t *session, char *tosay, ...@@ -237,9 +237,7 @@ static switch_status_t es_say_time(switch_core_session_t *session, char *tosay,
if ((p = strchr(tme, ':'))) { if ((p = strchr(tme, ':'))) {
*p++ = '\0'; *p++ = '\0';
minutes = atoi(p); minutes = atoi(p);
if (tme) { hours = atoi(tme);
hours = atoi(tme);
}
} else { } else {
minutes = atoi(tme); minutes = atoi(tme);
} }
......
...@@ -242,9 +242,7 @@ static switch_status_t fa_say_time(switch_core_session_t *session, char *tosay, ...@@ -242,9 +242,7 @@ static switch_status_t fa_say_time(switch_core_session_t *session, char *tosay,
if ((p = strchr(tme, ':'))) { if ((p = strchr(tme, ':'))) {
*p++ = '\0'; *p++ = '\0';
minutes = atoi(p); minutes = atoi(p);
if (tme) { hours = atoi(tme);
hours = atoi(tme);
}
} else { } else {
minutes = atoi(tme); minutes = atoi(tme);
} }
......
...@@ -227,9 +227,7 @@ static switch_status_t fr_say_time(switch_core_session_t *session, char *tosay, ...@@ -227,9 +227,7 @@ static switch_status_t fr_say_time(switch_core_session_t *session, char *tosay,
if ((p = strchr(tme, ':'))) { if ((p = strchr(tme, ':'))) {
*p++ = '\0'; *p++ = '\0';
minutes = atoi(p); minutes = atoi(p);
if (tme) { hours = atoi(tme);
hours = atoi(tme);
}
} else { } else {
minutes = atoi(tme); minutes = atoi(tme);
} }
......
...@@ -337,9 +337,7 @@ static switch_status_t he_say_time(switch_say_file_handle_t *sh, char *tosay, sw ...@@ -337,9 +337,7 @@ static switch_status_t he_say_time(switch_say_file_handle_t *sh, char *tosay, sw
if ((p = strchr(tme, ':'))) { if ((p = strchr(tme, ':'))) {
*p++ = '\0'; *p++ = '\0';
minutes = atoi(p); minutes = atoi(p);
if (tme) { hours = atoi(tme);
hours = atoi(tme);
}
} else { } else {
minutes = atoi(tme); minutes = atoi(tme);
} }
......
...@@ -486,9 +486,7 @@ static switch_status_t hr_say_time(switch_core_session_t *session, char *tosay, ...@@ -486,9 +486,7 @@ static switch_status_t hr_say_time(switch_core_session_t *session, char *tosay,
if ((p = strchr(tme, ':'))) { if ((p = strchr(tme, ':'))) {
*p++ = '\0'; *p++ = '\0';
minutes = atoi(p); minutes = atoi(p);
if (tme) { hours = atoi(tme);
hours = atoi(tme);
}
} else { } else {
minutes = atoi(tme); minutes = atoi(tme);
} }
......
...@@ -205,9 +205,7 @@ static switch_status_t hu_say_time(switch_core_session_t *session, char *tosay, ...@@ -205,9 +205,7 @@ static switch_status_t hu_say_time(switch_core_session_t *session, char *tosay,
if ((p = strchr(tme, ':'))) { if ((p = strchr(tme, ':'))) {
*p++ = '\0'; *p++ = '\0';
minutes = atoi(p); minutes = atoi(p);
if (tme) { hours = atoi(tme);
hours = atoi(tme);
}
} else { } else {
minutes = atoi(tme); minutes = atoi(tme);
} }
......
...@@ -251,9 +251,7 @@ static switch_status_t it_say_time(switch_core_session_t *session, char *tosay, ...@@ -251,9 +251,7 @@ static switch_status_t it_say_time(switch_core_session_t *session, char *tosay,
if ((p = strchr(tme, ':'))) { if ((p = strchr(tme, ':'))) {
*p++ = '\0'; *p++ = '\0';
minutes = atoi(p); minutes = atoi(p);
if (tme) { hours = atoi(tme);
hours = atoi(tme);
}
} else { } else {
minutes = atoi(tme); minutes = atoi(tme);
} }
......
...@@ -268,9 +268,7 @@ static switch_status_t ja_say_time(switch_core_session_t *session, char *tosay, ...@@ -268,9 +268,7 @@ static switch_status_t ja_say_time(switch_core_session_t *session, char *tosay,
if ((p = strchr(tme, ':'))) { if ((p = strchr(tme, ':'))) {
*p++ = '\0'; *p++ = '\0';
minutes = atoi(p); minutes = atoi(p);
if (tme) { hours = atoi(tme);
hours = atoi(tme);
}
} else { } else {
minutes = atoi(tme); minutes = atoi(tme);
} }
......
...@@ -195,9 +195,7 @@ static switch_status_t nl_say_time(switch_core_session_t *session, char *tosay, ...@@ -195,9 +195,7 @@ static switch_status_t nl_say_time(switch_core_session_t *session, char *tosay,
if ((p = strchr(tme, ':'))) { if ((p = strchr(tme, ':'))) {
*p++ = '\0'; *p++ = '\0';
minutes = atoi(p); minutes = atoi(p);
if (tme) { hours = atoi(tme);
hours = atoi(tme);
}
} else { } else {
minutes = atoi(tme); minutes = atoi(tme);
} }
......
...@@ -228,9 +228,7 @@ static switch_status_t pl_say_time(switch_say_file_handle_t *sh, char *tosay, sw ...@@ -228,9 +228,7 @@ static switch_status_t pl_say_time(switch_say_file_handle_t *sh, char *tosay, sw
if ((p = strchr(tme, ':'))) { if ((p = strchr(tme, ':'))) {
*p++ = '\0'; *p++ = '\0';
minutes = atoi(p); minutes = atoi(p);
if (tme) { hours = atoi(tme);
hours = atoi(tme);
}
} else { } else {
minutes = atoi(tme); minutes = atoi(tme);
} }
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
* *
* Anthony Minessale II <anthm@freeswitch.org> * Anthony Minessale II <anthm@freeswitch.org>
* Michael B. Murdock <mike@mmurdock.org> * Michael B. Murdock <mike@mmurdock.org>
* Antnio Silva <asilva@wirelessmundi.com> * António Silva <asilva@wirelessmundi.com>
* *
* mod_say_pt.c -- Say for Portuguese * mod_say_pt.c -- Say for Portuguese
* *
...@@ -184,7 +184,7 @@ static switch_status_t pt_say_general_count(switch_core_session_t *session, char ...@@ -184,7 +184,7 @@ static switch_status_t pt_say_general_count(switch_core_session_t *session, char
switch (say_args->method) { switch (say_args->method) {
case SSM_COUNTED: case SSM_COUNTED:
case SSM_PRONOUNCED: case SSM_PRONOUNCED:
/* specific case, one million => um milho */ /* specific case, one million => um milhão */
if (!places[8] && !places[7] && (places[6] == 1)) { if (!places[8] && !places[7] && (places[6] == 1)) {
say_file("digits/1.wav"); say_file("digits/1.wav");
say_file("digits/million.wav"); say_file("digits/million.wav");
...@@ -233,9 +233,7 @@ static switch_status_t pt_say_time(switch_core_session_t *session, char *tosay, ...@@ -233,9 +233,7 @@ static switch_status_t pt_say_time(switch_core_session_t *session, char *tosay,
if ((p = strchr(tme, ':'))) { if ((p = strchr(tme, ':'))) {
*p++ = '\0'; *p++ = '\0';
minutes = atoi(p); minutes = atoi(p);
if (tme) { hours = atoi(tme);
hours = atoi(tme);
}
} else { } else {
minutes = atoi(tme); minutes = atoi(tme);
} }
......
...@@ -368,9 +368,7 @@ static switch_status_t ru_say_time(switch_say_file_handle_t *sh, char *tosay, sw ...@@ -368,9 +368,7 @@ static switch_status_t ru_say_time(switch_say_file_handle_t *sh, char *tosay, sw
if ((p = strchr(tme, ':'))) { if ((p = strchr(tme, ':'))) {
*p++ = '\0'; *p++ = '\0';
minutes = atoi(p); minutes = atoi(p);
if (tme) { hours = atoi(tme);
hours = atoi(tme);
}
} else { } else {
minutes = atoi(tme); minutes = atoi(tme);
} }
......
...@@ -274,9 +274,7 @@ static switch_status_t sv_say_time(switch_say_file_handle_t *sh, char *tosay, sw ...@@ -274,9 +274,7 @@ static switch_status_t sv_say_time(switch_say_file_handle_t *sh, char *tosay, sw
if ((p = strchr(tme, ':'))) { if ((p = strchr(tme, ':'))) {
*p++ = '\0'; *p++ = '\0';
minutes = atoi(p); minutes = atoi(p);
if (tme) { hours = atoi(tme);
hours = atoi(tme);
}
} else { } else {
minutes = atoi(tme); minutes = atoi(tme);
} }
......
...@@ -257,9 +257,7 @@ static switch_status_t th_say_time(switch_core_session_t *session, char *tosay, ...@@ -257,9 +257,7 @@ static switch_status_t th_say_time(switch_core_session_t *session, char *tosay,
if ((p = strchr(tme, ':'))) { if ((p = strchr(tme, ':'))) {
*p++ = '\0'; *p++ = '\0';
minutes = atoi(p); minutes = atoi(p);
if (tme) { hours = atoi(tme);
hours = atoi(tme);
}
} else { } else {
minutes = atoi(tme); minutes = atoi(tme);
} }
......
...@@ -221,9 +221,7 @@ static switch_status_t zh_say_time(switch_core_session_t *session, char *tosay, ...@@ -221,9 +221,7 @@ static switch_status_t zh_say_time(switch_core_session_t *session, char *tosay,
if ((p = strchr(tme, ':'))) { if ((p = strchr(tme, ':'))) {
*p++ = '\0'; *p++ = '\0';
minutes = atoi(p); minutes = atoi(p);
if (tme) { hours = atoi(tme);
hours = atoi(tme);
}
} else { } else {
minutes = atoi(tme); minutes = atoi(tme);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论