summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fltk-widgets-inputs-float.adb4
-rw-r--r--src/fltk-widgets-inputs-integer.adb4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/fltk-widgets-inputs-float.adb b/src/fltk-widgets-inputs-float.adb
index f62fd00..b278b14 100644
--- a/src/fltk-widgets-inputs-float.adb
+++ b/src/fltk-widgets-inputs-float.adb
@@ -106,7 +106,9 @@ package body FLTK.Widgets.Inputs.Float is
is
Ptr : Interfaces.C.Strings.chars_ptr := fl_input_get_value (This.Void_Ptr);
begin
- if Ptr = Interfaces.C.Strings.Null_Ptr then
+ if Ptr = Interfaces.C.Strings.Null_Ptr or else
+ Interfaces.C.Strings.Value (Ptr) = ""
+ then
return 0.0;
else
return Standard.Float'Value (Interfaces.C.Strings.Value (Ptr));
diff --git a/src/fltk-widgets-inputs-integer.adb b/src/fltk-widgets-inputs-integer.adb
index d214a56..bc794e4 100644
--- a/src/fltk-widgets-inputs-integer.adb
+++ b/src/fltk-widgets-inputs-integer.adb
@@ -106,7 +106,9 @@ package body FLTK.Widgets.Inputs.Integer is
is
Ptr : Interfaces.C.Strings.chars_ptr := fl_input_get_value (This.Void_Ptr);
begin
- if Ptr = Interfaces.C.Strings.Null_Ptr then
+ if Ptr = Interfaces.C.Strings.Null_Ptr or else
+ Interfaces.C.Strings.Value (Ptr) = ""
+ then
return 0;
else
return Standard.Integer'Value (Interfaces.C.Strings.Value (Ptr));