rm unused preprocessor checks
[libpicofe.git] / menu.c
diff --git a/menu.c b/menu.c
index eb27ce6..04c0410 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -31,10 +31,8 @@ void *g_menuscreen_ptr;
 void *g_menubg_src_ptr;\r
 void *g_menubg_ptr;\r
 \r
-#if !MSCREEN_SIZE_FIXED\r
 int g_menuscreen_w;\r
 int g_menuscreen_h;\r
-#endif\r
 \r
 static unsigned char *menu_font_data = NULL;\r
 static int menu_text_color = 0xfffe; // default to white\r
@@ -983,12 +981,12 @@ static const char *menu_loop_romsel(char *curr_path, int len,
 \r
        // is this a dir or a full path?\r
        if (!plat_is_dir(curr_path)) {\r
-               char *p = curr_path + strlen(curr_path) - 1;\r
-               for (; p > curr_path && *p != '/'; p--)\r
-                       ;\r
-               *p = 0;\r
-               curr_path_restore = p;\r
-               snprintf(sel_fname, sizeof(sel_fname), "%s", p + 1);\r
+               char *p = strrchr(curr_path, '/');\r
+               if (p != NULL) {\r
+                       *p = 0;\r
+                       curr_path_restore = p;\r
+                       snprintf(sel_fname, sizeof(sel_fname), "%s", p + 1);\r
+               }\r
 \r
                if (rom_fname_reload[0] == 0)\r
                        show_help = 2;\r