diff --git a/src/IO/FileAccess.cpp b/src/IO/FileAccess.cpp index 970c7b0..8609c33 100644 --- a/src/IO/FileAccess.cpp +++ b/src/IO/FileAccess.cpp @@ -15,6 +15,7 @@ namespace hgl { fp=-1; mode=FileOpenMode::None; + hgl_zero(file_state); } FileAccess::~FileAccess() diff --git a/src/Text/LoadString.cpp b/src/Text/LoadString.cpp index 0b0b26a..e766d8c 100644 --- a/src/Text/LoadString.cpp +++ b/src/Text/LoadString.cpp @@ -87,6 +87,9 @@ namespace hgl */ int LoadStringFromText(UTF16String &full_text,const void *source_data,const int size,const CharSet &cs) { + if(!source_data||size<=0) + return(0); + const uint8 *data=(const uint8 *)source_data; u16char *str=nullptr; diff --git a/src/Time/DateTime.cpp b/src/Time/DateTime.cpp index c0a75bc..bc44cec 100644 --- a/src/Time/DateTime.cpp +++ b/src/Time/DateTime.cpp @@ -38,6 +38,7 @@ namespace hgl Time::Time() { + gmt_off=0; hours=0; minutes=0; seconds=0; @@ -51,6 +52,7 @@ namespace hgl Time::Time(int h,int m,int s,int ms) { + gmt_off=0; hours=h; minutes=m; seconds=s;