+ realloc values before creating the string

This commit is contained in:
kelson42 2012-05-19 19:16:26 +00:00
parent 9329a78528
commit f29a845682
2 changed files with 4 additions and 3 deletions

View File

@ -4,7 +4,7 @@
std::string getResourceAsString(const std::string &name) {
std::map<std::string, const char*>::iterator it = resourceMap.find(name);
if (it != resourceMap.end()) {
return std::string(resourceMap[name]);
return std::string(strdup(resourceMap[name]));
}
return "";
}

View File

@ -2,6 +2,7 @@
#define KIWIX_RESOURCETOOLS_H
#include <string>
#include <string.h>
#include <map>
std::string getResourceAsString(const std::string &name);
@ -21165,8 +21166,8 @@ const unsigned char server_home_html_tmpl[]={
0x0a,0x3c,0x62,0x6f,0x64,0x79,0x3e,0x0a,0x0a,0x3c,0x64,0x69,0x76,0x20,0x69,0x64,
0x3d,0x22,0x61,0x63,0x63,0x6f,0x72,0x64,0x69,0x6f,0x6e,0x22,0x3e,0x0a,0x20,0x20,
0x5f,0x5f,0x42,0x4f,0x4f,0x4b,0x53,0x5f,0x5f,0x0a,0x3c,0x2f,0x64,0x69,0x76,0x3e,
0x0a,0x0a,0x3c,0x2f,0x62,0x6f,0x64,0x79,0x3e,0x0a,0x3c,0x2f,0x68,0x74,0x6d,0x6c,
0x3e,0x0a
0x0a,0x3c,0x2f,0x62,0x6f,0x64,0x79,0x3e,0x0a,0x3c,0x2f,0x68,0x74,0x6d,0x6c,0x3e,
0x0a
};
const unsigned char server_taskbar_html_part[]={