naccyde / rpms / iproute

Forked from rpms/iproute 9 months ago
Clone

Blame SOURCES/0121-tc_util-No-need-to-terminate-an-snprintf-ed-buffer.patch

36cfb7
From 42b9cc605f54f2a3ad75a29b5f2fc308bfe5fc61 Mon Sep 17 00:00:00 2001
36cfb7
From: Andrea Claudi <aclaudi@redhat.com>
36cfb7
Date: Mon, 29 Apr 2019 20:09:12 +0200
36cfb7
Subject: [PATCH] tc_util: No need to terminate an snprintf'ed buffer
36cfb7
36cfb7
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1465646
36cfb7
Upstream Status: iproute2.git commit 9376314b49a47
36cfb7
36cfb7
commit 9376314b49a47eb42ade3fc0d41cb51438f8dbc6
36cfb7
Author: Phil Sutter <phil@nwl.cc>
36cfb7
Date:   Fri Sep 1 18:52:55 2017 +0200
36cfb7
36cfb7
    tc_util: No need to terminate an snprintf'ed buffer
36cfb7
36cfb7
    snprintf() won't leave the buffer unterminated, so manually terminating
36cfb7
    is not necessary here.
36cfb7
36cfb7
    Signed-off-by: Phil Sutter <phil@nwl.cc>
36cfb7
---
36cfb7
 tc/tc_util.c | 1 -
36cfb7
 1 file changed, 1 deletion(-)
36cfb7
36cfb7
diff --git a/tc/tc_util.c b/tc/tc_util.c
36cfb7
index 24ca1f1c1c040..296825ae174e0 100644
36cfb7
--- a/tc/tc_util.c
36cfb7
+++ b/tc/tc_util.c
36cfb7
@@ -430,7 +430,6 @@ const char *action_n2a(int action)
36cfb7
 		return "stolen";
36cfb7
 	default:
36cfb7
 		snprintf(buf, 64, "%d", action);
36cfb7
-		buf[63] = '\0';
36cfb7
 		return buf;
36cfb7
 	}
36cfb7
 }
36cfb7
-- 
e138d9
2.21.0
36cfb7