forked from github/server
Fix accidental parsing of empty strings (Bug 1917)
This commit is contained in:
parent
707262c61d
commit
2103c1725e
|
@ -2445,6 +2445,7 @@ static void reshow(unit * u, struct order *ord, const char *s, param_t p)
|
|||
cmistake(u, ord, 285, MSG_EVENT);
|
||||
break;
|
||||
case NOPARAM:
|
||||
if (s) {
|
||||
/* check if it's an item */
|
||||
itype = finditemtype(s, u->faction->locale);
|
||||
if (itype != NULL) {
|
||||
|
@ -2474,6 +2475,7 @@ static void reshow(unit * u, struct order *ord, const char *s, param_t p)
|
|||
if (rc != NULL && display_race(u->faction, u, rc)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
cmistake(u, ord, 21, MSG_EVENT);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -1397,7 +1397,7 @@ param_t findparam(const char *s, const struct locale * lang)
|
|||
char buffer[64];
|
||||
char * str = transliterate(buffer, sizeof(buffer)-sizeof(int), s);
|
||||
|
||||
if (str) {
|
||||
if (str && *str) {
|
||||
int i;
|
||||
const void * match;
|
||||
void **tokens = get_translations(lang, UT_PARAMS);
|
||||
|
|
Loading…
Reference in New Issue