Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2012-08

strlen and nil

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner

Hi,

What does strlen return on nil?
The FPC function strlen is implemented via FPC_PCHAR_LENGTH. The documentation does not say what happens when passing nil.

Mattias

Marco van de Voort
to Mattias Gaertner

In our previous episode, Mattias Gaertner said:

What does strlen return on nil? The FPC function strlen is implemented via FPC_PCHAR_LENGTH. The documentation does not say what happens when passing nil.

Both the generic and assembler implementation return 0.

Mattias Gaertner
to Marco van de Voort
Show quoted text 6 lines
In our previous episode, Mattias Gaertner said: > What does strlen return on nil? > The FPC function strlen is implemented via FPC_PCHAR_LENGTH. > The documentation does not say what happens when passing nil. Both the generic and assembler implementation return 0.

Thanks.
Can this be added to the docs?

Mattias

Unknown author
to Mattias Gaertner
Mattias Gaertner wrote 12 lines
On Wed, 1 Aug 2012 12:21:05 +0200 (CEST) (Marco van de Voort) wrote: > In our previous episode, Mattias Gaertner said: >> What does strlen return on nil? >> The FPC function strlen is implemented via FPC_PCHAR_LENGTH. >> The documentation does not say what happens when passing nil. > > Both the generic and assembler implementation return 0. Thanks. Can this be added to the docs?

Done. rev. 930.

Michael.