|
@@ -333,7 +333,7 @@ std::string File::decode(const char* str) {
|
333
|
333
|
const char* c = strchr(str, '&');
|
334
|
334
|
if (!c) return str;
|
335
|
335
|
|
336
|
|
- char decRet[strlen(str) + 1];
|
|
336
|
+ char* decRet = new char[strlen(str) + 1];
|
337
|
337
|
const char* last = str;
|
338
|
338
|
char* dstPt = decRet;
|
339
|
339
|
|
|
@@ -358,7 +358,7 @@ std::string File::decode(const char* str) {
|
358
|
358
|
} else {
|
359
|
359
|
const char* e = strchr(c, ';');
|
360
|
360
|
if (e) {
|
361
|
|
- char ent[e - 1 - c + 1];
|
|
361
|
+ char* ent = new char[e - 1 - c + 1];
|
362
|
362
|
memcpy(ent, c + 1, e - 1 - c);
|
363
|
363
|
ent[e - 1 - c] = 0;
|
364
|
364
|
const auto it = xml::ENTITIES.find(ent);
|
|
@@ -368,12 +368,15 @@ std::string File::decode(const char* str) {
|
368
|
368
|
dstPt += strlen(utf8);
|
369
|
369
|
last += strlen(ent) + 2;
|
370
|
370
|
}
|
|
371
|
+ delete[] ent;
|
371
|
372
|
}
|
372
|
373
|
}
|
373
|
374
|
}
|
374
|
375
|
|
375
|
376
|
strcpy(dstPt, last);
|
376
|
|
- return decRet;
|
|
377
|
+ std::string ret(decRet);
|
|
378
|
+ delete[] decRet;
|
|
379
|
+ return ret;
|
377
|
380
|
}
|
378
|
381
|
|
379
|
382
|
// _____________________________________________________________________________
|