]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc_util: No need to terminate an snprintf'ed buffer
authorPhil Sutter <phil@nwl.cc>
Fri, 1 Sep 2017 16:52:55 +0000 (18:52 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 1 Sep 2017 19:10:54 +0000 (12:10 -0700)
snprintf() won't leave the buffer unterminated, so manually terminating
is not necessary here.

Signed-off-by: Phil Sutter <phil@nwl.cc>
tc/tc_util.c

index 371046839ba9fcbb553676c287a525e5cb2fda57..50d355046bdada1ad26bf95fe299c05ad7ec121c 100644 (file)
@@ -434,7 +434,6 @@ static const char *action_n2a(int action)
                return "trap";
        default:
                snprintf(buf, 64, "%d", action);
-               buf[63] = '\0';
                return buf;
        }
 }