Permalink
Browse files

[osx] tiny fixes to cpu feature detect

  • Loading branch information...
1 parent c99bbf4 commit 1a62b26ef4c9ab3e1a63bfc27277cb770ae8da80 @davilla davilla committed Jan 29, 2011
Showing with 5 additions and 4 deletions.
  1. +5 −4 xbmc/utils/CPUInfo.cpp
View
@@ -554,26 +554,27 @@ void CCPUInfo::ReadCPUFeatures()
m_cpuFeatures |= CPU_FEATURE_ALTIVEC;
#elif defined(__arm__)
#else
- len = 512;
- char buffer[512];
+ size_t len = 512;
+ char buffer[512] ={0};
if (sysctlbyname("machdep.cpu.features", &buffer, &len, NULL, 0) == 0)
{
+ strcat(buffer, " ");
if (strstr(buffer,"MMX"))
m_cpuFeatures |= CPU_FEATURE_MMX;
if (strstr(buffer,"SSE "))
m_cpuFeatures |= CPU_FEATURE_SSE;
if (strstr(buffer,"SSE2"))
m_cpuFeatures |= CPU_FEATURE_SSE2;
- if (strstr(buffer,"SSE3"))
+ if (strstr(buffer,"SSE3 "))
m_cpuFeatures |= CPU_FEATURE_SSE3;
if (strstr(buffer,"SSSE3"))
m_cpuFeatures |= CPU_FEATURE_SSSE3;
if (strstr(buffer,"SSE4.1"))
m_cpuFeatures |= CPU_FEATURE_SSE4;
if (strstr(buffer,"SSE4.2"))
m_cpuFeatures |= CPU_FEATURE_SSE42;
- if (strstr(buffer,"3DNOW"))
+ if (strstr(buffer,"3DNOW "))
m_cpuFeatures |= CPU_FEATURE_3DNOW;
if (strstr(buffer,"3DNOWEXT"))
m_cpuFeatures |= CPU_FEATURE_3DNOWEXT;

0 comments on commit 1a62b26

Please sign in to comment.