fix two live warnings (unicode trim and fleechance registration)

This commit is contained in:
Enno Rehling 2017-03-27 18:07:44 +02:00
parent f2bb51b3ab
commit 03653a7338
2 changed files with 5 additions and 4 deletions

View File

@ -94,7 +94,6 @@ void register_attributes(void)
at_register(&at_woodcount);
/* neue UNIT-Attribute */
at_register(&at_fleechance);
at_register(&at_siege);
at_register(&at_effect);
at_register(&at_private);

View File

@ -1610,10 +1610,12 @@ int display_cmd(unit * u, struct order *ord)
free(*s);
if (s2) {
*s = strdup(s2);
if (strlen(s2) >= DISPLAYSIZE) {
(*s)[DISPLAYSIZE] = 0;
char * str = strdup(s2);
unicode_utf8_trim(str);
if (strlen(str) >= DISPLAYSIZE) {
str[DISPLAYSIZE-1] = 0;
}
*s = str;
}
else {
*s = 0;