From e217e1b42f8f61eb71c81d9f6d05e64a34c3ae9f Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 26 May 2021 17:18:26 +0200 Subject: core/pacman: fix the sse2 patch once more ^^ --- core/pacman/PKGBUILD | 2 +- .../replace-i686-by-pentium4-when-architecture-is-auto.patch | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'core') diff --git a/core/pacman/PKGBUILD b/core/pacman/PKGBUILD index 22f66813..fa05afd7 100644 --- a/core/pacman/PKGBUILD +++ b/core/pacman/PKGBUILD @@ -24,7 +24,7 @@ if [ ! "${CARCH}" = "i686" ]; then fi source+=('replace-i686-by-pentium4-when-architecture-is-auto.patch') -sha256sums+=('0c73e8d94d164a58cbd7e52987ec4f2dd9ab9b64518db5b602bf615da0ef9764') +sha256sums+=('f866cfe3df0108dba7e9468dbe11a29974f35ab3d6a65d7be67d2112adb1ce10') eval "$( { 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 /* isspace */ #include #include -@@ -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); -- cgit v1.2.3