From: Karel Zak Date: Tue, 14 May 2019 14:37:35 +0000 (+0200) Subject: lib/colors: keep static analyzer happy [coverity scan] X-Git-Tag: v2.34-rc2~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dcf6f5b3d9417274322ad79fc509c93754195f1a;p=thirdparty%2Futil-linux.git lib/colors: keep static analyzer happy [coverity scan] Signed-off-by: Karel Zak --- diff --git a/lib/colors.c b/lib/colors.c index bea7bd1d77..29f5c8569c 100644 --- a/lib/colors.c +++ b/lib/colors.c @@ -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; }