diff mbox series

[iproute,5/6] tc_util: No need to terminate an snprintf'ed buffer

Message ID 20170901165256.21459-6-phil@nwl.cc
State Accepted, archived
Delegated to: stephen hemminger
Headers show
Series strlcpy() and strlcat() for iproute2 | expand

Commit Message

Phil Sutter Sept. 1, 2017, 4:52 p.m. UTC
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 | 1 -
 1 file changed, 1 deletion(-)
diff mbox series

Patch

diff --git a/tc/tc_util.c b/tc/tc_util.c
index 371046839ba9f..50d355046bdad 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -434,7 +434,6 @@  static const char *action_n2a(int action)
 		return "trap";
 	default:
 		snprintf(buf, 64, "%d", action);
-		buf[63] = '\0';
 		return buf;
 	}
 }