Re: [COMMITTERS] pgsql: Avoid use of non-portable strnlen() in pgstat_clip_activity(). - Mailing list pgsql-committers

From Robert Haas
Subject Re: [COMMITTERS] pgsql: Avoid use of non-portable strnlen() in pgstat_clip_activity().
Date
Msg-id CA+Tgmoa+YBvWgFST2NVoeXjVSohEpK=vqnVCsoCkhTVVxfLcVQ@mail.gmail.com
Whole thread Raw
In response to [COMMITTERS] pgsql: Avoid use of non-portable strnlen() in pgstat_clip_activity().  (Andres Freund <andres@anarazel.de>)
List pgsql-committers
On Tue, Sep 19, 2017 at 5:27 PM, Andres Freund <andres@anarazel.de> wrote:
> Avoid use of non-portable strnlen() in pgstat_clip_activity().
>
> The use of strnlen rather than strlen was just paranoia. Instead of
> giving up on the paranoia, just implement the safeguard
> differently. And add a comment explaining why we're careful.
>
> Author: Andres Freund
> Discussion: https://postgr.es/m/E1duOkJ-0001Mc-U5@gemulon.postgresql.org

I think it should say a NUL byte or a \0 byte, not a NULL byte.  NULL
is a pointer value.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

pgsql-committers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [COMMITTERS] pgsql: Make new crash restart test a bit morerobust.
Next
From: Andres Freund
Date:
Subject: [COMMITTERS] pgsql: s/NULL byte/NUL byte/ in comment refering to C stringterminator