# SDL: n3ds: Check that audio thread name starts with "SDLAudioP" (b6170)

**URL:** <https://discourse.libsdl.org/t/sdl-n3ds-check-that-audio-thread-name-starts-with-sdlaudiop-b6170/46896>\
**Category:** SDL Commits\
**Created:** [October 25, 2023, 4:00am UTC](https://discourse.libsdl.org/t/sdl-n3ds-check-that-audio-thread-name-starts-with-sdlaudiop-b6170/46896 "2023-10-25T04:00:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [October 25, 2023, 4:00am UTC](https://discourse.libsdl.org/t/sdl-n3ds-check-that-audio-thread-name-starts-with-sdlaudiop-b6170/46896/1 "2023-10-25T04:00:39Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/b61706373c564e443f2a11875e58f2e9b505b0e2>
>
> The string has a number after it, so a basic SDL\_strcmp() will never match.
> 
> Ref…erence PR #8346.
> 
> (cherry picked from commit cba6090398f581415938aa53c232142c85d23009)

```diff
From b61706373c564e443f2a11875e58f2e9b505b0e2 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Tue, 24 Oct 2023 23:54:32 -0400
Subject: [PATCH] n3ds: Check that audio thread name starts with "SDLAudioP"

The string has a number after it, so a basic SDL_strcmp() will never match.

Reference PR #8346.

(cherry picked from commit cba6090398f581415938aa53c232142c85d23009)
---
 src/thread/n3ds/SDL_systhread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/thread/n3ds/SDL_systhread.c b/src/thread/n3ds/SDL_systhread.c
index 8e92e8dcdb78..348c03723089 100644
--- a/src/thread/n3ds/SDL_systhread.c
+++ b/src/thread/n3ds/SDL_systhread.c
@@ -55,7 +55,7 @@ int SDL_SYS_CreateThread(SDL_Thread *thread)
     svcGetThreadPriority(&priority, CUR_THREAD_HANDLE);
 
     /* prefer putting audio thread on system core */
- if (thread->name && SDL_strcmp(thread->name, "SDLAudioP") == 0 && R_SUCCEEDED(APT_SetAppCpuTimeLimit(30))) {
+ if (thread->name && (SDL_strncmp(thread->name, "SDLAudioP", 9) == 0) && R_SUCCEEDED(APT_SetAppCpuTimeLimit(30))) {
         cpu = 1;
     }
 

```
