summaryrefslogtreecommitdiff
path: root/core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch
diff options
context:
space:
mode:
Diffstat (limited to 'core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch')
-rw-r--r--core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch b/core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch
index 7e51a7ac..909a52d3 100644
--- a/core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch
+++ b/core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch
@@ -24,7 +24,7 @@ index 0f0c2cfb..b05c456d 100644
arch = newarch;
}
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
-index 7e810127..ab9ee5c9 100644
+index 7e810127..2a50fa4b 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -26,6 +26,7 @@
@@ -35,12 +35,13 @@ index 7e810127..ab9ee5c9 100644
#include <ctype.h> /* isspace */
#include <limits.h>
#include <getopt.h>
-@@ -274,8 +275,18 @@ static void setuseragent(void)
+@@ -274,8 +275,19 @@ 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);