mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
Test mkstemp replacement for tempfile.
This commit is contained in:
parent
e4bc6eac0e
commit
211dacdfd8
2 changed files with 13 additions and 2 deletions
|
|
@ -19,7 +19,7 @@ INC_DIR = ../include
|
|||
MINIZIP_DIR = ../third_party/minizip
|
||||
|
||||
# Flags passed to compiler.
|
||||
CFLAGS += -g -O3 -Wall -Wextra -pedantic -ansi
|
||||
CFLAGS += -g -O3 -Wall -Wextra -pedantic
|
||||
|
||||
# Library names.
|
||||
LIBXLSXWRITER_A = libxlsxwriter.a
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include "xlsxwriter/utility.h"
|
||||
|
||||
/*
|
||||
|
|
@ -411,5 +412,15 @@ lxw_quote_sheetname(char *str)
|
|||
FILE *
|
||||
lxw_tmpfile(void)
|
||||
{
|
||||
return tmpfile();
|
||||
char template[] = "/tmp/libxlsxwriter.XXXXXX";
|
||||
FILE *tempfile;
|
||||
int fd;
|
||||
|
||||
fd = mkstemp(template);
|
||||
tempfile = fdopen(fd, "w+");
|
||||
unlink(template);
|
||||
|
||||
return tempfile;
|
||||
|
||||
/* return tmpfile(); */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue