Minor file.c cleanup for valgrind, log PRI event properly
authorMark Spencer <markster@digium.com>
Wed, 18 Feb 2004 16:32:49 +0000 (16:32 +0000)
committerMark Spencer <markster@digium.com>
Wed, 18 Feb 2004 16:32:49 +0000 (16:32 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2189 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c
file.c

index 3550573..eb4cc05 100755 (executable)
@@ -6661,7 +6661,7 @@ static void *pri_dchannel(void *vpri)
                        x = 0;
                        res = ioctl(pri->fd, ZT_GETEVENT, &x);
                        if (x) 
-                               printf("PRI got event: %d\n", x);
+                               ast_log(LOG_NOTICE, "PRI got event: %d on span %d\n", x, pri->span);
                        if (option_debug)
                                ast_log(LOG_DEBUG, "Got event %s (%d) on D-channel for span %d\n", event2str(x), x, pri->span);
                }
diff --git a/file.c b/file.c
index 9869eb3..f9a421e 100755 (executable)
--- a/file.c
+++ b/file.c
@@ -274,7 +274,7 @@ static int copy(char *infile, char *outfile)
 static char *build_filename(char *filename, char *ext)
 {
        char *fn;
-       char tmp[AST_CONFIG_MAX_PATH];
+       char tmp[AST_CONFIG_MAX_PATH]="";
        snprintf(tmp,sizeof(tmp)-1,"%s/%s",(char *)ast_config_AST_VAR_DIR,"sounds");
        fn = malloc(strlen(tmp) + strlen(filename) + strlen(ext) + 10);
        if (fn) {