Re-fix bug #1977 (bug #1997)
authorMark Spencer <markster@digium.com>
Thu, 8 Jul 2004 15:03:48 +0000 (15:03 +0000)
committerMark Spencer <markster@digium.com>
Thu, 8 Jul 2004 15:03:48 +0000 (15:03 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3398 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index f6938c2..12363ac 100755 (executable)
@@ -1665,12 +1665,11 @@ static void run_externnotify(char *context, char *extension)
        char arguments[255];
        int newvoicemails = 0, oldvoicemails = 0;
 
-       if(externnotify[0]) {
+       if(!ast_strlen_zero(externnotify)) {
                if (ast_app_messagecount(extension, &newvoicemails, &oldvoicemails)) {
                        ast_log(LOG_ERROR, "Problem in calculating number of voicemail messages available for extension %s\n", extension);
                } else {
-                       strncpy(arguments, externnotify, sizeof(arguments));
-                       snprintf(arguments, sizeof(arguments)-1, "%s %s %s %d&", externnotify, context, extension, newvoicemails);
+                       snprintf(arguments, sizeof(arguments), "%s %s %s %d&", externnotify, context, extension, newvoicemails);
                        ast_log(LOG_DEBUG,"Executing %s\n", arguments);
                        ast_safe_system(arguments);
                }