Fix directory name in SMS (bug #2307)
authorMark Spencer <markster@digium.com>
Thu, 26 Aug 2004 21:28:42 +0000 (21:28 +0000)
committerMark Spencer <markster@digium.com>
Thu, 26 Aug 2004 21:28:42 +0000 (21:28 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3659 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_sms.c

index f8251c6..0f23ebc 100755 (executable)
@@ -1069,11 +1069,11 @@ sms_exec(struct ast_channel *chan, void *data)
                        return -1;
                }
                for (p = d; *p && *p != '|'; p++);
-               if (p - d >= sizeof (h.queue)) {
+               if (p - d + 1 >= sizeof (h.queue)) {
                        ast_log (LOG_ERROR, "Queue name too long\n");
                        return -1;
                }
-               strncpy(h.queue, d, p - d - 1);
+               strncpy(h.queue, d, p - d);
                if (*p == '|')
                        p++;
                d = p;