Merged revisions 306967 via svnmerge from
authorJeff Peeler <jpeeler@digium.com>
Tue, 8 Feb 2011 19:42:03 +0000 (19:42 +0000)
committerJeff Peeler <jpeeler@digium.com>
Tue, 8 Feb 2011 19:42:03 +0000 (19:42 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r306967 | jpeeler | 2011-02-08 13:41:42 -0600 (Tue, 08 Feb 2011) | 16 lines

  Merged revisions 306966 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2

  ................
    r306966 | jpeeler | 2011-02-08 13:41:21 -0600 (Tue, 08 Feb 2011) | 9 lines

    Merged revisions 306965 via svnmerge from
    https://origsvn.digium.com/svn/asterisk/branches/1.4

    ........
      r306965 | jpeeler | 2011-02-08 13:40:58 -0600 (Tue, 08 Feb 2011) | 1 line

      fix this line again
    ........
  ................
................

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306968 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index 8b26a60..e4fa608 100644 (file)
@@ -3928,7 +3928,7 @@ static int last_message_index(struct ast_vm_user *vmu, char *dir)
        }
 
        while ((msgdirent = readdir(msgdir))) {
-               if (!strcmp(extension, "txt") && msgdirint < MAXMSGLIMIT && sscanf(msgdirent->d_name, "msg%10d.%3s", &msgdirint, extension) == 2) {
+               if (sscanf(msgdirent->d_name, "msg%30d.%3s", &msgdirint, extension) == 2 && !strcmp(extension, "txt") && msgdirint < MAXMSGLIMIT) {
                        map[msgdirint] = 1;
                        stopcount++;
                        ast_debug(4, "%s map[%d] = %d, count = %d\n", dir, msgdirint, map[msgdirint], stopcount);