Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MediaArea/ZenLib.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorJérôme Martinez <jerome@mediaarea.net>2020-11-20 19:48:15 +0300
committerGitHub <noreply@github.com>2020-11-20 19:48:15 +0300
commitf8148e21935bfd52f98627d26c1811235352a014 (patch)
tree38ec166ad946b2ca3c483371087e75c6b75e4c44 /Source
parentd67388435008ab94a6a19452d89f713043932747 (diff)
parent6475fcccd37c9cf17e0cfe263b5fe0e2e47a8408 (diff)
Merge pull request #119 from pavel-pimenov/fix-Gmt
fix V522 There might be dereferencing of a potential null pointer 'Gmt'
Diffstat (limited to 'Source')
-rw-r--r--Source/ZenLib/Ztring.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/ZenLib/Ztring.cpp b/Source/ZenLib/Ztring.cpp
index bc38fe4..21bbc58 100644
--- a/Source/ZenLib/Ztring.cpp
+++ b/Source/ZenLib/Ztring.cpp
@@ -1364,6 +1364,8 @@ Ztring& Ztring::Date_From_Seconds_1970_Local (const int32u Value)
#endif
Ztring DateT;
Ztring Date;
+ if (Gmt)
+ {
Date+=Ztring::ToZtring((Gmt->tm_year+1900));
Date+=__T("-");
DateT.From_Number(Gmt->tm_mon+1); if (DateT.size()<2){DateT=Ztring(__T("0"))+Ztring::ToZtring(Gmt->tm_mon+1);}
@@ -1381,6 +1383,7 @@ Ztring& Ztring::Date_From_Seconds_1970_Local (const int32u Value)
DateT.From_Number(Gmt->tm_sec); if (DateT.size()<2){DateT=Ztring(__T("0"))+Ztring::ToZtring(Gmt->tm_sec);}
Date+=DateT;
assign (Date.c_str());
+ }
return *this;
}