]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/colors: keep static analyzer happy [coverity scan]
authorKarel Zak <kzak@redhat.com>
Tue, 14 May 2019 14:37:35 +0000 (16:37 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 14 May 2019 14:37:35 +0000 (16:37 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/colors.c

index bea7bd1d77c441b5d3c95b685bacf1132538fc8b..29f5c8569cf5a1a331ac4e05814582f82a23f315 100644 (file)
@@ -424,8 +424,10 @@ static int cn_sequence(const char *str, char **seq)
                in++;
        }
 
-       assert ((out - *seq) <= len);
-       *out = '\0';
+       if (out) {
+               assert ((out - *seq) <= len);
+               *out = '\0';
+       }
 
        return 0;
 }