summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2022-11-30 19:32:31 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2022-11-30 19:32:31 +1300
commit8dd289655ff9ed17ae16bf6b7197ae3ae6c07b3e (patch)
treee22e2205205aac0162fff4a39109d916d46f1b44
parent16de49a1a4d086c8839139b2130c0b42c90c914a (diff)
Fixed bug in Float_Input and Integer_Input Get_Value functions
-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));