fix #300134 and file test logic

- mktmp never returns NULL, so test logic was borken
- use mkstemp instead of mktemp
merge-requests/1/head
Stéphane Voltz 2015-09-14 06:46:51 +02:00
rodzic 26572efbd1
commit 6c7f9f6a3b
2 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -1,3 +1,6 @@
2015-09-14 Stéphane Voltz <stef.dev@free.fr>
* backend/bh.c: replace mktemp by mkstemp #300134
2015-09-13 Paul Newall <p dot newalls at ntlworld dot com>
* backend/kodakaio.c:
redundant variable bitposn and redundant function kodakaio_rxflush

Wyświetl plik

@ -1863,10 +1863,9 @@ start_scan (BH_Scanner *s)
strncpy(s->barfname, "/tmp/bhXXXXXX", sizeof(s->barfname));
s->barfname[sizeof(s->barfname)-1] = '\0';
fd = mkstemp(s->barfname);
if ((mktemp(s->barfname) == NULL) &&
((fd = open(s->barfname, O_CREAT | O_EXCL | O_WRONLY, 0600)) != -1) &&
((fp = fdopen(fd, "w")) != NULL))
if (fd !=-1 && (fp = fdopen(fd, "w")) != NULL)
{
fprintf(fp, "<xml-stream>\n");