Fix: attempt to fix improper use of negative value
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 15 Aug 2017 21:36:19 +0000 (17:36 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 15 Aug 2017 22:06:36 +0000 (18:06 -0400)
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 <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
logging/log.c

index 49a3061a11c95084b3376498a52f5c8f4f3b7753..1a9fed4bc486c8fcec0673daf1569d020dcbd5ad 100644 (file)
@@ -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);
This page took 0.024573 seconds and 4 git commands to generate.