[retro-gtk] environment: Don't dereference a nullable pointer



commit 94bb0d3c3a429a1cef225f1ed91b4f8ef8fed1ef
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Mon Jul 26 12:21:24 2021 +0200

    environment: Don't dereference a nullable pointer
    
    This fixes a crash.

 retro-runner/retro-environment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/retro-runner/retro-environment.c b/retro-runner/retro-environment.c
index 90beda0..d49558d 100644
--- a/retro-runner/retro-environment.c
+++ b/retro-runner/retro-environment.c
@@ -361,7 +361,7 @@ get_username (RetroCore    *self,
 {
   *(username) = retro_core_get_user_name (self);
 
-  if (**username == '\0')
+  if (g_strcmp0 (*username, "") == 0)
     *(username) = NULL;
 
   retro_debug ("Get username: %s", *username);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]