Re: pgsql: Add pg_strnlen() a portable implementation of strlen.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Add pg_strnlen() a portable implementation of strlen.
Date: 2017-10-10 20:37:04
Message-ID: 21088.1507667824@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Andres Freund <andres(at)anarazel(dot)de> writes:
> (there's definitely fixes to be made to where strnlen's replacement is
> located, but regardless, this needs to be fixed too)

Given that strnlen is standardized by POSIX, and has been for nigh a
decade, I think it'd be all right for us to treat it as a straight
port replacement function, a la strlcpy() for instance. That is,
forget the pg_ prefix and just create a strnlen() function if the
platform has not got it.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2017-10-10 20:46:03 Re: pgsql: Add pg_strnlen() a portable implementation of strlen.
Previous Message Andres Freund 2017-10-10 19:48:18 Re: pgsql: Add pg_strnlen() a portable implementation of strlen.