mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Truncate file as appropriate (bug #3304)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -772,6 +772,8 @@ static int retrieve_file(char *dir, int msgnum)
|
||||
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
|
||||
goto yuck;
|
||||
}
|
||||
fdlen = colsize;
|
||||
ftruncate(fd, fdlen);
|
||||
}
|
||||
} else {
|
||||
res = SQLGetData(stmt, x + 1, SQL_CHAR, rowdata, sizeof(rowdata), NULL);
|
||||
@@ -780,7 +782,6 @@ static int retrieve_file(char *dir, int msgnum)
|
||||
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
|
||||
goto yuck;
|
||||
}
|
||||
printf("Got field '%s'\n", coltitle);
|
||||
if (strcmp(coltitle, "msgnum") && strcmp(coltitle, "dir") && f)
|
||||
fprintf(f, "%s=%s\n", coltitle, rowdata);
|
||||
}
|
||||
|
Reference in New Issue
Block a user