diff options
-rw-r--r-- | channels/misdn_config.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/misdn_config.c b/channels/misdn_config.c index 3643d67e2..293b8f8cb 100644 --- a/channels/misdn_config.c +++ b/channels/misdn_config.c @@ -821,7 +821,9 @@ void misdn_cfg_get_config_string (int port, enum misdn_cfg_elements elem, char* for (; iter; iter = iter->next) { strncat(tempbuf, iter->msn, sizeof(tempbuf) - strlen(tempbuf) - 1); } - tempbuf[strlen(tempbuf)-2] = 0; + if (strlen(tempbuf) > 1) { + tempbuf[strlen(tempbuf)-2] = 0; + } } snprintf(buf, bufsize, " -> msns: %s", *tempbuf ? tempbuf : "none"); break; |