rnd-20001210-2-src
[rocksndiamonds.git] / src / libgame / system.c
index 8a5feabea7f532cc343c83acc8e1661b72f14c87..5217460d47f80ed11a9dc3dcb4b14b7de09790cf 100644 (file)
@@ -555,10 +555,8 @@ inline boolean ChangeVideoModeIfNeeded(boolean fullscreen)
 Bitmap *LoadImage(char *basename)
 {
   Bitmap *new_bitmap;
-  char filename[256];
-
-  sprintf(filename, "%s/%s/%s",
-         options.ro_base_directory, GRAPHICS_DIRECTORY, basename);
+  char *filename = getPath3(options.ro_base_directory, GRAPHICS_DIRECTORY,
+                           basename);
 
 #if defined(TARGET_SDL)
   new_bitmap = SDLLoadImage(filename);
@@ -566,6 +564,8 @@ Bitmap *LoadImage(char *basename)
   new_bitmap = X11LoadImage(filename);
 #endif
 
+  free(filename);
+
   return new_bitmap;
 }