diff options
author | Jed Barber <jjbarber@y7mail.com> | 2018-05-15 16:30:58 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2018-05-15 16:30:58 +1000 |
commit | d45103f2445ed59b7ba78faeae8061327c4ab976 (patch) | |
tree | 78b9aba4e3d7a303473400b6c809ecf657c4b9e1 /src/fltk-static.adb | |
parent | 1cd018b440f80601f60908c2e5675413f5c77e25 (diff) |
Fixed errors with Event Dispatch and null string pointers
Diffstat (limited to 'src/fltk-static.adb')
-rw-r--r-- | src/fltk-static.adb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/fltk-static.adb b/src/fltk-static.adb index 41771f9..3ec3938 100644 --- a/src/fltk-static.adb +++ b/src/fltk-static.adb @@ -8,7 +8,8 @@ with use type - Interfaces.C.int; + Interfaces.C.int, + Interfaces.C.Strings.chars_ptr; package body FLTK.Static is @@ -721,6 +722,7 @@ package body FLTK.Static is (Kind : in Font_Kind) return String is begin + -- should never get a null string in return since it's from an enum return Interfaces.C.Strings.Value (fl_static_get_font (Font_Kind'Pos (Kind))); end Font_Image; @@ -729,6 +731,7 @@ package body FLTK.Static is (Kind : in Font_Kind) return String is begin + -- should never get a null string in return since it's from an enum return Interfaces.C.Strings.Value (fl_static_get_font_name (Font_Kind'Pos (Kind))); end Font_Family_Image; @@ -947,9 +950,15 @@ package body FLTK.Static is function Get_Scheme - return String is + return String + is + Ptr : Interfaces.C.Strings.chars_ptr := fl_static_get_scheme; begin - return Interfaces.C.Strings.Value (fl_static_get_scheme); + if Ptr = Interfaces.C.Strings.Null_Ptr then + return ""; + else + return Interfaces.C.Strings.Value (Ptr); + end if; end Get_Scheme; |