mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-07-05 11:59:41 +01:00
(svn r21326) -Fix: off-by-one in case choice list construction causing case lists to fail completely
This commit is contained in:
parent
09e88969cf
commit
4e6d29351e
@ -327,21 +327,19 @@ struct UnmappedChoiceList : ZeroedMemoryAllocator {
|
|||||||
*d++ = i;
|
*d++ = i;
|
||||||
|
|
||||||
/* "<LENn>" */
|
/* "<LENn>" */
|
||||||
size_t len = strlen(str);
|
size_t len = strlen(str) + 1;
|
||||||
*d++ = GB(len, 8, 8);
|
*d++ = GB(len, 8, 8);
|
||||||
*d++ = GB(len, 0, 8);
|
*d++ = GB(len, 0, 8);
|
||||||
|
|
||||||
/* "<STRINGn>" */
|
/* "<STRINGn>" */
|
||||||
memcpy(d, str, len);
|
memcpy(d, str, len);
|
||||||
d += len;
|
d += len;
|
||||||
*d++ = '\0';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* "<STRINGDEFAULT>" */
|
/* "<STRINGDEFAULT>" */
|
||||||
size_t len = strlen(this->strings[0]);
|
size_t len = strlen(this->strings[0]) + 1;
|
||||||
memcpy(d, this->strings[0], len);
|
memcpy(d, this->strings[0], len);
|
||||||
d += len;
|
d += len;
|
||||||
*d++ = '\0';
|
|
||||||
} else {
|
} else {
|
||||||
if (this->type == SCC_PLURAL_LIST) {
|
if (this->type == SCC_PLURAL_LIST) {
|
||||||
*d++ = lm->plural_form;
|
*d++ = lm->plural_form;
|
||||||
|
Loading…
Reference in New Issue
Block a user