summaryrefslogtreecommitdiff
path: root/wsutil/tempfile.c
AgeCommit message (Collapse)AuthorFilesLines
2017-04-18Check the result of localtime().Guy Harris1-2/+6
Unlikely to fail, but it squelches CID 1398220. Change-Id: I0e40146f0a32c1082e84052c6b3e382fe6a15ae7 Reviewed-on: https://code.wireshark.org/review/21177 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-22More checks for localtime() and gmtime() returning NULL.Guy Harris1-0/+1
And some comments in the case where we're converting the result of time() - if your machine's idea of time predates January 1, 1970, 00:00:00 UTC, it'll crash on Windows, but that's not a case where a *file* can cause the problem due either to a bad file time stamp or bad time stamps in the file. Change-Id: I837a438e4b875dd8c4f3ec2137df7a16ee4e9498 Reviewed-on: https://code.wireshark.org/review/18369 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-01Fix compile error:Joerg Mayer1-1/+1
[ 0%] Building C object wsutil/CMakeFiles/wsutil.dir/tempfile.c.o /Users/jmayer/worktmp/wireshark/git/wsutil/tempfile.c:228:37: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32] fd = mkstemps(tf[idx].path, sfx ? strlen(sfx) : 0); ~~~~~~~~ ^~~~~~~~~~~ 1 error generated. No idea whether this is the correct fix. Change-Id: I80202d7eaad11fc3dcb5f9847f6e162caccb7e6e Reviewed-on: https://code.wireshark.org/review/15672 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2016-06-01Allow create_tempfile to support a suffix.Michael Mann1-16/+19
Ping-Bug: 10203 Change-Id: Ifa24870d711449b87e9839dd46af614e4aa28fde Reviewed-on: https://code.wireshark.org/review/15608 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2016-04-13Windows: Remove the need for _CRT_NONSTDC_NO_DEPRECATE.Gerald Combs1-4/+4
Replace some function calls with their non-deprecated equivalents so that we can remove _CRT_NONSTDC_NO_DEPRECATE from CMakeLists.txt and config.nmake. Leave _CRT_SECURE_NO_DEPRECATE in place. Removing it failed with 145 warnings and 72 errors. Note that we could probably improve startup performance by using wmem in diam_dict.*. Change-Id: I6e130003de838aebedbdd1aa78c50de8a339ddcb Reviewed-on: https://code.wireshark.org/review/14883 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-07Clean up includes of unistd.h, fcntl.h, and sys/stat.h.Guy Harris1-8/+0
Have wsutil/file_util.h include them on UN*X, just as it includes io.h on Windows, so we can have a rule of "if you do file operations, include <wsutil/file_util.h> and use the routines in it". Remove includes of unistd.h, fcntl.h, and sys/stat.h that aren't necessary (whether because of the addition of them to wsutil/file_util.h or because they weren't needed in the first place). Change-Id: Ie241dd74deff284e39a5f690a297dbb6e1dc485f Reviewed-on: https://code.wireshark.org/review/11619 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-05-09Rename a variable to avoid a collision with the C++ keyword "template".Guy Harris1-15/+15
Change-Id: I27c5efc5586e97d19ef905921919e1385809eb9b Reviewed-on: https://code.wireshark.org/review/8367 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-28Add a couple of more needed includesMartin Mathieson1-1/+1
Change-Id: Ie160f81544c6c9b381078b555e91602617cb2700 Reviewed-on: https://code.wireshark.org/review/6101 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-28Deleting unnecessary #includes from wsutil.Martin Mathieson1-4/+0
Will look at cleaning up and committing script afterwards. Change-Id: Id785e581740ab62fe9258ecfcb0926761ad9c527 Reviewed-on: https://code.wireshark.org/review/6086 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-11-19[pedantic] Replace usage of 'long' and 'long long'Bill Meier1-2/+2
Change-Id: I78fc82c1a83eb04d78a11fc76710c92dfc916208 Reviewed-on: https://code.wireshark.org/review/5395 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-14Add editor-modelines; adjust whitespace.Bill Meier1-99/+112
Change-Id: I8cad872cee972a6d22a72852dac57fd188daca84 Reviewed-on: https://code.wireshark.org/review/4683 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2013-11-17Move get_tempfile_path() from filesystem.[ch] to tempfile.[ch].Guy Harris1-3/+9
svn path=/trunk/; revision=53379
2013-06-26Move tempfile.{h,c} into wsutil.Jeff Morriss1-0/+279
svn path=/trunk/; revision=50163