]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Always fflush for any CDR file (not only for Master.csv) (bug #2586)
authorRussell Bryant <russell@russellbryant.com>
Fri, 8 Oct 2004 02:43:08 +0000 (02:43 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 8 Oct 2004 02:43:08 +0000 (02:43 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@3943 65c4cc65-6c06-0410-ace0-fbb531ad65f3

cdr/cdr_csv.c

index a1d391cfb714683c0d55ca7a528c84f530599c5a..95598bd52b386c9e840b73f76d7160ae9bf8c60b 100755 (executable)
@@ -184,7 +184,7 @@ static int build_csv_record(char *buf, size_t bufsize, struct ast_cdr *cdr)
 
 static int writefile(char *s, char *acc)
 {
-       char tmp[256];
+       char tmp[AST_CONFIG_MAX_PATH];
        FILE *f;
        if (strchr(acc, '/') || (acc[0] == '.')) {
                ast_log(LOG_WARNING, "Account code '%s' insecure for writing file\n", acc);
@@ -195,6 +195,7 @@ static int writefile(char *s, char *acc)
        if (!f)
                return -1;
        fputs(s, f);
+       fflush(f);
        fclose(f);
        return 0;
 }