]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
state: _never_ return NULL from lxc_state2str()
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 22 Feb 2021 14:28:07 +0000 (15:28 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 23 Feb 2021 12:57:44 +0000 (13:57 +0100)
Cc: Thomas Parrott <thomas.parrott@canonical.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/state.c

index b4345e5a4a43529ea0f56805321248fde091e82f..0682b35da58bdb27bd88126430493269403ad2b2 100644 (file)
@@ -36,7 +36,7 @@ static const char *const strstate[] = {
 const char *lxc_state2str(lxc_state_t state)
 {
        if (state < STOPPED || state > MAX_STATE - 1)
-               return NULL;
+               return "INVALID STATE";
        return strstate[state];
 }