minor code cleanup
authorHolger Schemel <holger.schemel@virtion.de>
Sat, 11 May 2024 12:05:47 +0000 (14:05 +0200)
committerHolger Schemel <holger.schemel@virtion.de>
Sat, 11 May 2024 12:05:47 +0000 (14:05 +0200)
src/files.c

index ad0686319b94adfa80143698cd0233df7ad0bd41..7b2d7b2d7e728c68d090bd1c8e25d51ad752a6e6 100644 (file)
@@ -4645,11 +4645,9 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level)
 
   // level name
   char *cave_name_latin1 = getLatin1FromUTF8(cave->name);
-  char *cave_name_final;
-  if (gd_caveset_has_levels())
-    cave_name_final = getStringPrint("%s / %d", cave_name_latin1, bd_level_nr + 1);
-  else
-    cave_name_final = getStringCopy(cave_name_latin1);
+  char *cave_name_final = (gd_caveset_has_levels() ?
+                           getStringPrint("%s / %d", cave_name_latin1, bd_level_nr + 1) :
+                           getStringCopy(cave_name_latin1));
 
   strncpy(level->name, cave_name_final, MAX_LEVEL_NAME_LEN);
   level->name[MAX_LEVEL_NAME_LEN] = '\0';