forked from github/server
coverity warning: NEGATIVE_RETURNS
This commit is contained in:
parent
03a94d1264
commit
5e48eac26a
|
@ -144,7 +144,7 @@ typedef enum {
|
|||
P_TREES,
|
||||
P_ALLIANCE,
|
||||
MAXPARAMS,
|
||||
NOPARAM = -1
|
||||
NOPARAM
|
||||
} param_t;
|
||||
|
||||
typedef enum { /* Fehler und Meldungen im Report */
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
const char * keyword(keyword_t kwd)
|
||||
{
|
||||
static char result[32]; // FIXME: static return value
|
||||
if (kwd==NOKEYWORD) {
|
||||
return NULL;
|
||||
}
|
||||
if (!result[0]) {
|
||||
strcpy(result, "keyword::");
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ extern "C"
|
|||
K_PAY,
|
||||
K_LOOT,
|
||||
MAXKEYWORDS,
|
||||
NOKEYWORD = -1
|
||||
NOKEYWORD
|
||||
} keyword_t;
|
||||
|
||||
extern const char *keywords[MAXKEYWORDS];
|
||||
|
|
|
@ -11,11 +11,13 @@
|
|||
static void test_init_keywords(CuTest *tc) {
|
||||
struct locale *lang;
|
||||
|
||||
test_cleanup();
|
||||
test_setup();
|
||||
lang = get_or_create_locale("en");
|
||||
locale_setstring(lang, "keyword::move", "MOVE");
|
||||
init_keywords(lang);
|
||||
CuAssertIntEquals(tc, K_MOVE, get_keyword("move", lang));
|
||||
CuAssertStrEquals(tc, "keyword::move", keyword(K_MOVE));
|
||||
CuAssertPtrEquals(tc, NULL, (void *)keyword(NOKEYWORD));
|
||||
test_cleanup();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue