xmlinterface.cpp: avoid unterminated strings

Signed-off-by: MarkusVolk <f_l_k@t-online.de>


Origin commit data
------------------
Branch: ni/coolstream
Commit: 2d93a4385d
Author: Markus Volk <f_l_k@t-online.de>
Date: 2020-01-14 (Tue, 14 Jan 2020)



------------------
This commit was generated by Migit
This commit is contained in:
Markus Volk
2020-01-14 21:22:46 +01:00
committed by vanhofen
parent 8af885bb1d
commit 89c6988adb

View File

@@ -311,8 +311,8 @@ xmlDocPtr parseXmlFile(const char * filename, bool,const char* encoding)
size_t read_size = gzread(xmlgz_file,buffer,gzsize);
char utf8[3];
strncpy(utf8,(char *)buffer,3);
char utf8[4];
strncpy(utf8,(char *)buffer,sizeof(utf8)-1);
if ((utf8[0] == 0xef) && (utf8[1] == 0xbb) && (utf8[2] == 0xbf))
enc = pugi::encoding_utf8;