[SOLVED] StringToHex might not return a result lazarus / 64-FPC development ---------------------------------------------------------------------- lagprogramming · 2023-08-11 18:22 packages/fcl-hash/src/fphashutils.pp has the following function Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function StringToHex(const s: ansistring): ansistring;begin  if s='' then exit;  BytesToHexStr(Result,@s[1],length(s));end;The code of this function might not assign a result. ---------------------------------------------------------------------- domasz · 2023-08-11 18:28 Seems someone forgot 3 chars Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i     function StringToHex(const s: ansistring): ansistring;    begin      if s='' then exit(s);      BytesToHexStr(Result,@s[1],length(s));    end; ---------------------------------------------------------------------- lagprogramming · 2023-08-11 18:33 Quote from: domasz on August 11, 2023, 08:28:17 pmSeems someone forgot 3 chars Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i     function StringToHex(const s: ansistring): ansistring;    begin      if s='' then exit(s);      BytesToHexStr(Result,@s[1],length(s));    end;Maybe 4: exit(''); Edit: Should this function be allowed to return an empty string?  We'll see. ---------------------------------------------------------------------- Thaddy · 2023-08-11 18:38 That is flawed indeed, use syutils and the helper ToHexString. ---------------------------------------------------------------------- AlexTP · 2023-08-12 09:49 Posted to https://gitlab.com/freepascal.org/fpc/source/-/issues/40388