]> git.mxchange.org Git - flightgear.git/commitdiff
Patch from Jim Wilson:
authordavid <david>
Thu, 9 May 2002 21:15:01 +0000 (21:15 +0000)
committerdavid <david>
Thu, 9 May 2002 21:15:01 +0000 (21:15 +0000)
Turns out it was a problem with a long string, not the font.  Plib is limited
to 80 characters in things like this listbox.  BTW I checked and all the fonts
are missing those characters.  So, no point in changing.

Description:
Fixed segfault caused by long string.

src/GUI/prop_picker.cxx

index dbb99615b97d6eba237682496d91aed848114035..38002a0a6dd5a71c514351a77e0276514cb8bbc7 100755 (executable)
@@ -500,6 +500,11 @@ void fgPropPicker::find_props ()
             ++pi;
   }
 
+  // truncate entries to 80 characters (plib pui limit)
+  for (i = 0; i < num_files; i++) {
+    if (strlen(files[i]) > 80) files[i][79] = '\0';
+  }
+
   files [ num_files ] = NULL ;
 
   // leave the . and .. alone...
@@ -607,3 +612,4 @@ fgPropEdit::fgPropEdit ( char *name, char *value, char *proppath ) : puDialogBox
         
     FG_FINALIZE_PUI_DIALOG( this );
 }
+