diff mbox

[iproute2,v2,1/2] arpd: drop unnecessary explicit null termination

Message ID 1451846374-2665-1-git-send-email-andreas@fatal.se
State Changes Requested, archived
Delegated to: stephen hemminger
Headers show

Commit Message

Andreas Henriksson Jan. 3, 2016, 6:39 p.m. UTC
This is a followup to a previous commit 61170fd88d264c
"get rid of unnecessary fgets() buffer size limitation".

If fgets guarantees buffer will be null terminated in the
given size, then we can also drop the explicit termination.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
---
 misc/arpd.c | 1 -
 1 file changed, 1 deletion(-)
diff mbox

Patch

diff --git a/misc/arpd.c b/misc/arpd.c
index 6bb9bd1..700dc50 100644
--- a/misc/arpd.c
+++ b/misc/arpd.c
@@ -702,7 +702,6 @@  int main(int argc, char **argv)
 			goto do_abort;
 		}
 
-		buf[sizeof(buf)-1] = 0;
 		while (fgets(buf, sizeof(buf), fp)) {
 			__u8 b1[6];
 			char ipbuf[128];