From 8b7092e4d4b8a536fcff183de0cffd3949931f39 Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Sun, 11 Sep 2022 02:44:19 -0700 Subject: [PATCH] gpu_apple.c: Use Ascii encoding --- .gitignore | 1 + CMakeLists.txt | 2 ++ src/detection/gpu/gpu_apple.c | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d2a2da19d..f604d255a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ **/.vscode/ **/.cache/ **/.kdev4/ +**/.DS_Store cscope.* tags fastfetch.kdev4 diff --git a/CMakeLists.txt b/CMakeLists.txt index 71f6b6624..891d2b91e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -411,6 +411,8 @@ if(LINUX) set(CPACK_RPM_PACKAGE_LICENSE "MIT") elseif(APPLE) set(CPACK_GENERATOR "${CPACK_GENERATOR};DragNDrop") + + set(CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK TRUE) endif() set(CPACK_SET_DESTDIR ON) diff --git a/src/detection/gpu/gpu_apple.c b/src/detection/gpu/gpu_apple.c index ada1c2be0..f699ffe09 100644 --- a/src/detection/gpu/gpu_apple.c +++ b/src/detection/gpu/gpu_apple.c @@ -61,7 +61,7 @@ void ffDetectGPUImpl(FFlist* gpus, const FFinstance* instance) continue; } - CFStringRef key = ffCFStringCreateWithCStringNoCopy(NULL, "model", kCFStringEncodingUTF8, *ffkCFAllocatorNull); + CFStringRef key = ffCFStringCreateWithCStringNoCopy(NULL, "model", kCFStringEncodingASCII, *ffkCFAllocatorNull); CFStringRef model = ffCFDictionaryGetValue(properties, key); if(model == NULL || ffCFGetTypeID(model) != ffCFDataGetTypeID()) { @@ -74,7 +74,7 @@ void ffDetectGPUImpl(FFlist* gpus, const FFinstance* instance) uint32_t modelLength = (uint32_t) ffCFStringGetLength(model); ffStrbufInitA(&gpu->name, modelLength + 1); - ffCFStringGetCString(model, gpu->name.chars, modelLength + 1, kCFStringEncodingUTF8); + ffCFStringGetCString(model, gpu->name.chars, modelLength + 1, kCFStringEncodingASCII); gpu->name.length = modelLength; gpu->name.chars[gpu->name.length] = '\0';