From 03653a733881f49937c3be4efdad4ce6be4d11cb Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 27 Mar 2017 18:07:44 +0200 Subject: [PATCH] fix two live warnings (unicode trim and fleechance registration) --- src/attributes/attributes.c | 1 - src/laws.c | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/attributes/attributes.c b/src/attributes/attributes.c index 0fe42a92e..c4925b9c0 100644 --- a/src/attributes/attributes.c +++ b/src/attributes/attributes.c @@ -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); diff --git a/src/laws.c b/src/laws.c index 736510cd2..9b3e9946a 100644 --- a/src/laws.c +++ b/src/laws.c @@ -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;