[fpc-pascal] StrToHostAddr in sockets unit accepts negative octets

2020-04-19 Thread Noel Duffy via fpc-pascal
Running fpc 3.0.4 on Fedora 30. The StrToHostAddr function in the sockets unit accepts negative octets in the source ip address. Consider this program: program ip4_neg; {$mode objfpc}{$H+} uses sockets; var ip4_addr: in_addr; begin ip4_addr := StrToHostAddr('172.-16.32.14'); if

Re: [fpc-pascal] StrToHostAddr in sockets unit accepts negative octets

2020-04-19 Thread Karoly Balogh (Charlie/SGR)
Hi, On Sun, 19 Apr 2020, Michael Van Canneyt wrote: > > The StrToHostAddr function in the sockets unit accepts negative octets > > in the source ip address. Consider this program: > > This should indeed be ckecked. > Please report this in the bugtracker, so we don't forget to look at it! I have

Re: [fpc-pascal] StrToHostAddr in sockets unit accepts negative octets

2020-04-19 Thread Michael Van Canneyt
On Sun, 19 Apr 2020, Noel Duffy via fpc-pascal wrote: Running fpc 3.0.4 on Fedora 30. The StrToHostAddr function in the sockets unit accepts negative octets in the source ip address. Consider this program: This should indeed be ckecked. Please report this in the bugtracker, so we don't

Re: [fpc-pascal] FormatSettings in library vs application

2020-04-19 Thread Luca Olivetti
El 19/4/20 a les 19:11, Graeme Geldenhuys ha escrit: 2) Is the better solution to define a local TFormatSettings, define the ShortDateFormat for that record, and then pass that to DateToStr as the 2nd parameter? You could also use FormatDateTime Bye -- Luca

Re: [fpc-pascal] Error format question

2020-04-19 Thread Sven Barth via fpc-pascal
Am 12.04.2020 um 09:40 schrieb Sven Barth: Ryan Joseph via fpc-pascal > schrieb am So., 12. Apr. 2020, 08:53: > On Apr 12, 2020, at 11:16 AM, Ryan Joseph mailto:generic...@gmail.com>> wrote: > > I just did svn up and got r44689, rebuilt the

Re: [fpc-pascal] FormatSettings in library vs application

2020-04-19 Thread Jonas Maebe
On 19/04/2020 19:11, Graeme Geldenhuys wrote: > 1) Will this function change the ShortDateFormat for the whole > application, or is the scope just inside that function? It will be just that library, unless the library is compiled as a dynamic package. > 2) Is the better solution to define a

[fpc-pascal] FormatSettings in library vs application

2020-04-19 Thread Graeme Geldenhuys
Hi, It's been over a year since I looked at any Object Pascal code, so a bit rusty. [bows his head in shame] :-) I'm maintaining a library that uses the function seen below. I any FPC (or Lazarus) application uses this library (eg: via a lcl package). 1) Will this function change the