]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
play.c: Replace NULL check by assertion. master
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 13 May 2024 21:32:52 +0000 (23:32 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 26 May 2024 16:12:45 +0000 (18:12 +0200)
If p is NULL, kma contains no colon, and we should not be here in the
first place. Instead, we should have errored out much earlier in the
command line parser.

Suggested-by: gcc(1)
play.c

diff --git a/play.c b/play.c
index bd183b6b8dd48906e08cf142d7ff8c1e05aad48a..4adedcc0475a6a810513989499ab31b752d2a945 100644 (file)
--- a/play.c
+++ b/play.c
@@ -580,8 +580,7 @@ static char *get_user_key_map_seq(int key)
        char *result;
        int len;
 
-       if (!p)
-               return NULL;
+       assert(p);
        len = p - kma;
        result = alloc(len + 1);
        memcpy(result, kma, len);