rnd-20030704-1-src
[rocksndiamonds.git] / src / files.c
index 787013ba2e1e17ebc8daa5cffbfd04623ebcf7e1..1396b60e47c1db782ea4551a0106e66572e0efa8 100644 (file)
@@ -105,10 +105,14 @@ static void setLevelInfoToDefaults()
   {
     int element = EL_CUSTOM_START + i;
 
-    for(j=0; j<MAX_ELEMENT_NAME_LEN; j++)
+    for(j=0; j<MAX_ELEMENT_NAME_LEN + 1; j++)
       element_info[element].description[j] = '\0';
-    strcpy(element_info[element].description,
-          element_info[element].editor_description);
+    if (element_info[element].custom_description != NULL)
+      strncpy(element_info[element].description,
+             element_info[element].custom_description, MAX_ELEMENT_NAME_LEN);
+    else
+      strcpy(element_info[element].description,
+            element_info[element].editor_description);
 
     element_info[element].use_gfx_element = FALSE;
     element_info[element].gfx_element = EL_EMPTY_SPACE;