mirror of https://github.com/kiwix/libkiwix.git
+ realloc values before creating the string
This commit is contained in:
parent
9329a78528
commit
f29a845682
|
@ -4,7 +4,7 @@
|
||||||
std::string getResourceAsString(const std::string &name) {
|
std::string getResourceAsString(const std::string &name) {
|
||||||
std::map<std::string, const char*>::iterator it = resourceMap.find(name);
|
std::map<std::string, const char*>::iterator it = resourceMap.find(name);
|
||||||
if (it != resourceMap.end()) {
|
if (it != resourceMap.end()) {
|
||||||
return std::string(resourceMap[name]);
|
return std::string(strdup(resourceMap[name]));
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define KIWIX_RESOURCETOOLS_H
|
#define KIWIX_RESOURCETOOLS_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <string.h>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
std::string getResourceAsString(const std::string &name);
|
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,
|
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,
|
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,
|
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,
|
0x0a,0x3c,0x2f,0x62,0x6f,0x64,0x79,0x3e,0x0a,0x3c,0x2f,0x68,0x74,0x6d,0x6c,0x3e,
|
||||||
0x3e,0x0a
|
0x0a
|
||||||
};
|
};
|
||||||
|
|
||||||
const unsigned char server_taskbar_html_part[]={
|
const unsigned char server_taskbar_html_part[]={
|
||||||
|
|
Loading…
Reference in New Issue