Skip to content

Commit 0d9b173

Browse files
committed
changed screen saver client name
1 parent 7ac6493 commit 0d9b173

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/core/webos/SDL_webos_init.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ int SDL_webOSRegisterApp()
7070
}
7171
if (SDL_GetHintBoolean(SDL_HINT_WEBOS_REGISTER_APP, SDL_TRUE)) {
7272
const char *appId = SDL_getenv("APPID");
73+
if (appId == NULL) {
74+
return SDL_SetError("APPID environment variable is not set");
75+
}
7376
s_nativeLifeCycleInterfaceVersion = getNativeLifeCycleInterfaceVersion(appId);
7477
if (s_nativeLifeCycleInterfaceVersion == -1) {
7578
char errbuf[1024];
@@ -242,8 +245,7 @@ static SDL_bool registerScreenSaverRequest(const char *appId)
242245
char *client_name;
243246
SDL_bool result;
244247

245-
client_name = SDL_malloc(64);
246-
SDL_snprintf(client_name, 64, "%s.wakelock", appId);
248+
client_name = SDL_strdup(appId);
247249
payload = PBNJSON_jobject_create_var(
248250
PBNJSON_jkeyval(J_CSTR_TO_JVAL("subscribe"), PBNJSON_jboolean_create(1)),
249251
PBNJSON_jkeyval(J_CSTR_TO_JVAL("clientName"), PBNJSON_j_cstr_to_jval(client_name)),

0 commit comments

Comments
 (0)