[pacman-dev,5/5] remove unused byte from user agent buffer

Message ID 20170510225457.18270-5-andrew.gregory.8@gmail.com
State Accepted, archived
Headers show
Series [pacman-dev,1/5] alpm_unlock: check handle before dereferencing | expand

Commit Message

Andrew Gregory May 10, 2017, 10:54 p.m. UTC
snprintf prints at most n bytes including the terminating '\0'.  The
extra reserved byte was never being used.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
---
 src/pacman/pacman.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 11b7e6f0..8c7f715e 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -269,7 +269,7 @@  static void localize(void)
  */
 static void setuseragent(void)
 {
-	char agent[101];
+	char agent[100];
 	struct utsname un;
 	int len;