Avoid use of non-portable strnlen() in pgstat_clip_activity().

Andres Freund <andres@anarazel.de>

Commit: 71edbb6f66f7139d6209334ef8734a122ba06b56
Author: Andres Freund <andres@anarazel.de>
Date: 2017-09-19T21:25:47Z
Releases: 11.0
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

Files

PathChange+/−
src/backend/postmaster/pgstat.c modified +21 −4
src/include/pgstat.h modified +1 −1

Discussion

Cited messages not in the archive: E1duOkJ-0001Mc-U5@gemulon.postgresql.org