Re: Faster StrNCpy - Mailing list pgsql-hackers

From Benny Amorsen
Subject Re: Faster StrNCpy
Date
Msg-id m3sli5v8l3.fsf@ursa.amorsen.dk
Whole thread Raw
In response to Re: Faster StrNCpy  (mark@mark.mielke.cc)
List pgsql-hackers
>>>>> "ZA" == Zeugswetter Andreas DCP SD <ZeugswetterA@spardat.at> writes:

ZA> Yes, but it obviously does not in some ports, and that was the
ZA> main problem as I interpreted it.

strncpy is part of POSIX; I highly doubt anyone gets it wrong. Getting
sane semantics from it does require manually writing null to the
last location in the buffer.

If you need the null byte padding feature of strncpy, it seems a bit
silly to replace it with strlcpy. Particularly if the only reason is
performance. Down that road lies pglibc.


/Benny




pgsql-hackers by date:

Previous
From: Zdenek Kotala
Date:
Subject: Updated version of FAQ_Solaris
Next
From: "Mark Woodward"
Date:
Subject: Netflix Prize data