forked from github/server
Fixing new factions
This commit is contained in:
parent
e18d5b849d
commit
305942414c
2 changed files with 4 additions and 2 deletions
|
@ -89,9 +89,10 @@ xml_s(const char * str)
|
|||
const char * inbuf = str;
|
||||
unsigned char * outbuf = buffer;
|
||||
size_t inbytes = strlen(str)+1;
|
||||
size_t outbytes = sizeof(buffer);
|
||||
size_t outbytes = sizeof(buffer) - 1;
|
||||
|
||||
unicode_latin1_to_utf8(outbuf, &outbytes, (const xmlChar *)inbuf, &inbytes);
|
||||
buffer[outbytes] = 0;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
|
|
@ -244,9 +244,10 @@ read_newfactions(const char * filename)
|
|||
nf->race = findrace(race, default_locale);
|
||||
if (nf->race==NULL) {
|
||||
char buffer[32];
|
||||
size_t outbytes = sizeof(buffer);
|
||||
size_t outbytes = sizeof(buffer) - 1;
|
||||
size_t inbytes = strlen(race);
|
||||
unicode_latin1_to_utf8((unsigned char *)buffer, &outbytes, (const unsigned char *)race, &inbytes);
|
||||
buffer[outbytes] = 0;
|
||||
nf->race = findrace(buffer, default_locale);
|
||||
if (nf->race==NULL) {
|
||||
log_error(("new faction has unknown race '%s'.\n", race));
|
||||
|
|
Loading…
Reference in a new issue