From: Mathieu Desnoyers Date: Tue, 15 Aug 2017 21:36:19 +0000 (-0400) Subject: Fix: attempt to fix improper use of negative value X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=ee07b1e97986cfaf1ee0753230191c44fea9f470;p=deliverable%2Fbabeltrace.git Fix: attempt to fix improper use of negative value Found by Coverity, unsure that the fix will make it happy: CID 1376189 (#1 of 1): Improper use of negative value (NEGATIVE_RETURNS)negative_returns: Passing negative constant -1 to a parameter that cannot be negative. [hide details] Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- diff --git a/logging/log.c b/logging/log.c index 49a3061a1..1a9fed4bc 100644 --- a/logging/log.c +++ b/logging/log.c @@ -905,7 +905,7 @@ static char *put_integer_r(unsigned v, const int sign, const unsigned w, const char wc, char *const e) { static const char _signs[] = {'-', '0', '+'}; - static const char *const signs = _signs + 1; + const char *const signs = _signs + 1; char *p = e; do { *--p = '0' + v % 10; } while (0 != (v /= 10)); if (0 == sign) return put_padding_r(w, wc, p, e);