Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
brechtsanders committed Mar 24, 2016
1 parent 15a26ce commit 834265b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
0.1.6

2016-03-24 Brecht Sanders https://github.com/brechtsanders/

* delete destination file before writing to it
* fixed corruption issue when closing if no rows were written

0.1.5

2016-03-20 Brecht Sanders https://github.com/brechtsanders/
Expand Down
5 changes: 5 additions & 0 deletions lib/xlsxio_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,8 @@ DLL_EXPORT_XLSXIO xlsxiowriter xlsxiowrite_open (const char* filename, const cha
}
handle->pipe_read = fdopen(pipefd[0], "rb");
handle->pipe_write = fdopen(pipefd[1], "wb");
//remove filename if it already exists
unlink(filename);
//create and start thread that will receive data via pipe
#ifdef USE_WINTHREADS
if ((handle->thread = CreateThread(NULL, 0, thread_proc, handle, 0, NULL)) == NULL) {
Expand All @@ -474,6 +476,9 @@ DLL_EXPORT_XLSXIO int xlsxiowrite_close (xlsxiowriter handle)
return -1;
//finalize data
if (handle->pipe_write) {
//check if buffer should be flushed
if (!handle->sheetopen)
flush_buffer(handle);
//close row if needed
if (handle->rowopen)
fprintf(handle->pipe_write, "</row>");
Expand Down

0 comments on commit 834265b

Please sign in to comment.