diff options
| author | Karel Zak <kzak@redhat.com> | 2019-05-14 16:37:35 +0200 |
|---|---|---|
| committer | Karel Zak <kzak@redhat.com> | 2019-05-14 16:37:35 +0200 |
| commit | dcf6f5b3d9417274322ad79fc509c93754195f1a (patch) | |
| tree | 5c766d232193fbb9d20cb60b09b920070590ed10 | |
| parent | 0ed52c662eea74f4c8a6d926f601a3c77fa3ff69 (diff) | |
| download | util-linux-dcf6f5b3d9417274322ad79fc509c93754195f1a.tar.gz | |
lib/colors: keep static analyzer happy [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
| -rw-r--r-- | lib/colors.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; } |
