File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff 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 )),
You can’t perform that action at this time.
0 commit comments