TrilbyWhite/Leela

mkstemp replaced mktemp

Opened this issue · 2 comments

Hello TrilbyWhite and thanks for Leela:
this morning pdfshuffler let me down so I installed Leela. It did the trick very well (and so light!).

For the record, I got a warning when compiling:
leela.c:(.text+0x90f): AVERTISSEMENT: the use of 'mktemp' is dangerous, better use 'mkstemp'
My machine is singled user, and I do not manipulated secret PDF files: bug does not concern me much.

Thanks for the report - I'm glad you found leela useful. As other tools provided by poppler and ghostscript have come a long way since I first made leela there are fewer and fewer useful features that leela provides that can't be better done with those tools, so I've really not done much with the code in a long time.

Replaceing the mktemp with mkstemp should be trivial, but that code is only used in one function (the "append" function). Based on a test I just did, that function is currently completely failing anyways, there's likely been a change in the poppler API that I'd need to adjust for. But as the append function is one that is definitely well covered by poppler's own binaries now, I'll likely just remove that function entirely when I get around to it.

Thanks for your lengthy post, interresting indeed.
I shall try using poppler directly then.
It is fine by me that you should remove the function.