summaryrefslogtreecommitdiff
path: root/src/fltk-menu_items.adb
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2018-05-15 16:30:58 +1000
committerJed Barber <jjbarber@y7mail.com>2018-05-15 16:30:58 +1000
commitd45103f2445ed59b7ba78faeae8061327c4ab976 (patch)
tree78b9aba4e3d7a303473400b6c809ecf657c4b9e1 /src/fltk-menu_items.adb
parent1cd018b440f80601f60908c2e5675413f5c77e25 (diff)
Fixed errors with Event Dispatch and null string pointers
Diffstat (limited to 'src/fltk-menu_items.adb')
-rw-r--r--src/fltk-menu_items.adb13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/fltk-menu_items.adb b/src/fltk-menu_items.adb
index 4c0e78c..69a8014 100644
--- a/src/fltk-menu_items.adb
+++ b/src/fltk-menu_items.adb
@@ -9,7 +9,8 @@ with
use type
System.Address,
- Interfaces.C.int;
+ Interfaces.C.int,
+ Interfaces.C.Strings.chars_ptr;
package body FLTK.Menu_Items is
@@ -340,9 +341,15 @@ package body FLTK.Menu_Items is
function Get_Label
(Item : in Menu_Item)
- return String is
+ return String
+ is
+ Ptr : Interfaces.C.Strings.chars_ptr := fl_menu_item_get_label (Item.Void_Ptr);
begin
- return Interfaces.C.Strings.Value (fl_menu_item_get_label (Item.Void_Ptr));
+ if Ptr = Interfaces.C.Strings.Null_Ptr then
+ return "";
+ else
+ return Interfaces.C.Strings.Value (Ptr);
+ end if;
end Get_Label;
procedure Set_Label