index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | src/pacman/pacman.c | 5 |
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); |