diff options
-rw-r--r-- | apps/app_mixmonitor.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/app_mixmonitor.c b/apps/app_mixmonitor.c index 63454895f..910e72cb1 100644 --- a/apps/app_mixmonitor.c +++ b/apps/app_mixmonitor.c @@ -280,6 +280,7 @@ static void *mixmonitor_thread(void *obj) struct ast_filestream **fs = NULL; unsigned int oflags; char *ext; + char *last_slash; int errflag = 0; struct ast_format format_slin; @@ -313,7 +314,8 @@ static void *mixmonitor_thread(void *obj) oflags = O_CREAT | O_WRONLY; oflags |= ast_test_flag(mixmonitor, MUXFLAG_APPEND) ? O_APPEND : O_TRUNC; - if ((ext = strrchr(mixmonitor->filename, '.'))) + last_slash = strrchr(mixmonitor->filename, '/'); + if ((ext = strrchr(mixmonitor->filename, '.')) && (ext > last_slash)) *(ext++) = '\0'; else ext = "raw"; |