Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pacman/pacman.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index cf30325b..b5bd2a37 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -275,8 +275,9 @@ static void setuseragent(void)
int len;
uname(&un);
- char machine[8];
- strncpy(machine, un.machine, 8);
+ char machine[9];
+ strncpy(machine, un.machine, sizeof machine);
+ machine[sizeof machine-1] = '\0';
if(strcmp(machine, "i686") == 0) {
int eax, ebx, ecx, edx;
__get_cpuid(1, &eax, &ebx, &ecx, &edx);