[Libreoffice-commits] libvisio.git: src/lib
David Tardon
dtardon at redhat.com
Sat Jul 6 04:41:11 PDT 2013
src/lib/VSDFieldList.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 73a17a5730bfbfb738cf0fa4fe59ad4b478f9731
Author: David Tardon <dtardon at redhat.com>
Date: Sat Jul 6 13:34:10 2013 +0200
coverity: gmtime can return NULL
diff --git a/src/lib/VSDFieldList.cpp b/src/lib/VSDFieldList.cpp
index 20c1759..d7efe29 100644
--- a/src/lib/VSDFieldList.cpp
+++ b/src/lib/VSDFieldList.cpp
@@ -74,8 +74,12 @@ WPXString libvisio::VSDNumericField::datetimeToString(const char *format, double
WPXString result;
char buffer[MAX_BUFFER];
time_t timer = (time_t)(86400 * datetime - 2209161600.0);
- strftime(&buffer[0], MAX_BUFFER-1, format, gmtime(&timer));
- result.append(&buffer[0]);
+ const struct tm *const time = gmtime(&timer);
+ if (time)
+ {
+ strftime(&buffer[0], MAX_BUFFER-1, format, time);
+ result.append(&buffer[0]);
+ }
return result;
}
More information about the Libreoffice-commits
mailing list