diff --git a/channels/misdn_config.c b/channels/misdn_config.c index d5879fa420..95485ffd62 100644 --- a/channels/misdn_config.c +++ b/channels/misdn_config.c @@ -794,7 +794,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;