Op 12/05/2020 om 23:05 schreef Noel Duffy via fpc-pascal:
function TryStrToHostAddr(IP: String; var ip4: in_addr): Boolean;
function TryStrToHostAddr6(IP: String; var ip6: in6_addr): Boolean;
Rationale for this request: All conversion calls in sysutils and
dateutils use this naming scheme, it's good for consistency.
(and I hate underscores, but that's beside the point ;))
Yes to the principle and yes to the TryStrTo naming. But I would make
the IP param CONST ;-)
Good idea, and normally I would, but the current implementation of
StrToHostAddr (see below) does Delete on IP as it processes it. As it
currently stands this function must accept a non-const.
Miight have been when posex() was in strutils, however nowadays Pos()
accepts a start index too. Even shortstring only versions.
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal