Don't crash when pause/stop keys aren't defined on the command line (Bug #3514)
authorJosh Roberson <josh@asteriasgi.com>
Sun, 6 Feb 2005 06:43:32 +0000 (06:43 +0000)
committerJosh Roberson <josh@asteriasgi.com>
Sun, 6 Feb 2005 06:43:32 +0000 (06:43 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4970 65c4cc65-6c06-0410-ace0-fbb531ad65f3

file.c

diff --git a/file.c b/file.c
index f0761b1..85e66a7 100755 (executable)
--- a/file.c
+++ b/file.c
@@ -995,6 +995,14 @@ char ast_waitstream_fr(struct ast_channel *c, const char *breakon, const char *f
 {
        int res;
        struct ast_frame *fr;
+
+       if (!breakon)
+                       breakon = "";
+       if (!forward)
+                       forward = "";
+       if (!rewind)
+                       rewind = "";
+       
        while(c->stream) {
                res = ast_sched_wait(c->sched);
                if ((res < 0) && !c->timingfunc) {
@@ -1059,6 +1067,9 @@ char ast_waitstream_full(struct ast_channel *c, const char *breakon, int audiofd
        int outfd;
        struct ast_frame *fr;
        struct ast_channel *rchan;
+
+       if (!breakon)
+               breakon = "";
        
        while(c->stream) {
                ms = ast_sched_wait(c->sched);