forked from github/server
fix two live warnings (unicode trim and fleechance registration)
This commit is contained in:
parent
f2bb51b3ab
commit
03653a7338
|
@ -94,7 +94,6 @@ void register_attributes(void)
|
||||||
at_register(&at_woodcount);
|
at_register(&at_woodcount);
|
||||||
|
|
||||||
/* neue UNIT-Attribute */
|
/* neue UNIT-Attribute */
|
||||||
at_register(&at_fleechance);
|
|
||||||
at_register(&at_siege);
|
at_register(&at_siege);
|
||||||
at_register(&at_effect);
|
at_register(&at_effect);
|
||||||
at_register(&at_private);
|
at_register(&at_private);
|
||||||
|
|
|
@ -1610,10 +1610,12 @@ int display_cmd(unit * u, struct order *ord)
|
||||||
|
|
||||||
free(*s);
|
free(*s);
|
||||||
if (s2) {
|
if (s2) {
|
||||||
*s = strdup(s2);
|
char * str = strdup(s2);
|
||||||
if (strlen(s2) >= DISPLAYSIZE) {
|
unicode_utf8_trim(str);
|
||||||
(*s)[DISPLAYSIZE] = 0;
|
if (strlen(str) >= DISPLAYSIZE) {
|
||||||
|
str[DISPLAYSIZE-1] = 0;
|
||||||
}
|
}
|
||||||
|
*s = str;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*s = 0;
|
*s = 0;
|
||||||
|
|
Loading…
Reference in New Issue