diff options
Diffstat (limited to 'src/fltk-dialogs.adb')
-rw-r--r-- | src/fltk-dialogs.adb | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/fltk-dialogs.adb b/src/fltk-dialogs.adb index 7f0629c..349fd1f 100644 --- a/src/fltk-dialogs.adb +++ b/src/fltk-dialogs.adb @@ -168,7 +168,11 @@ package body FLTK.Dialogs is Interfaces.C.To_C (Default)); begin -- string does not need dealloc - return Interfaces.C.Strings.Value (Result); + if Result = Interfaces.C.Strings.Null_Ptr then + return ""; + else + return Interfaces.C.Strings.Value (Result); + end if; end Text_Input; @@ -189,7 +193,11 @@ package body FLTK.Dialogs is Interfaces.C.To_C (Default)); begin -- string does not need dealloc - return Interfaces.C.Strings.Value (Result); + if Result = Interfaces.C.Strings.Null_Ptr then + return ""; + else + return Interfaces.C.Strings.Value (Result); + end if; end Password; @@ -248,7 +256,11 @@ package body FLTK.Dialogs is Boolean'Pos (Relative)); begin -- I'm... fairly sure the string does not need dealloc? - return Interfaces.C.Strings.Value (Result); + if Result = Interfaces.C.Strings.Null_Ptr then + return ""; + else + return Interfaces.C.Strings.Value (Result); + end if; end Dir_Chooser; @@ -264,7 +276,11 @@ package body FLTK.Dialogs is Boolean'Pos (Relative)); begin -- I'm... fairly sure the string does not need dealloc? - return Interfaces.C.Strings.Value (Result); + if Result = Interfaces.C.Strings.Null_Ptr then + return ""; + else + return Interfaces.C.Strings.Value (Result); + end if; end File_Chooser; |