From d6458841c9134a3b6d8ca260766fca64a72740aa Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Wed, 22 Jan 2025 15:40:12 +1300 Subject: Arc testing program and Valuator Format subprogram bugfix --- body/fltk-widgets-valuators.adb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'body') diff --git a/body/fltk-widgets-valuators.adb b/body/fltk-widgets-valuators.adb index 4b8db3f..0cf8d65 100644 --- a/body/fltk-widgets-valuators.adb +++ b/body/fltk-widgets-valuators.adb @@ -198,13 +198,16 @@ package body FLTK.Widgets.Valuators is pragma Assert (Userdata /= Null_Pointer); Ada_Obj := Valuator_Convert.To_Pointer (Storage.To_Address (Userdata)); declare + -- God this whole Format method is sketchy as hell. + -- ...what? This is the area to declare things and that needed declaring. String_Result : String := Ada_Obj.Format; begin if String_Result'Length <= FLTK.Buffer_Size then - Interfaces.C.Strings.Update (Buffer, 0, String_Result); + Interfaces.C.Strings.Update (Buffer, 0, Interfaces.C.To_C (String_Result), False); return String_Result'Length; else - Interfaces.C.Strings.Update (Buffer, 0, String_Result (1 .. Buffer_Size)); + Interfaces.C.Strings.Update + (Buffer, 0, Interfaces.C.To_C (String_Result (1 .. Buffer_Size)), False); return Interfaces.C.int (FLTK.Buffer_Size); end if; end; -- cgit