mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
Rewrite strnlen replacement implementation from 8a241792f9.
The previous placement of the fallback implementation in libpgcommon was problematic, because libpqport functions need strnlen functionality. Move replacement into libpgport. Provide strnlen() under its posix name, instead of pg_strnlen(). Fix stupid configure bug, executing the test only when compiled with threading support. Author: Andres Freund Discussion: https://postgr.es/m/E1e1gR2-0005fB-SI@gemulon.postgresql.org
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
|
||||
#include "postgres.h"
|
||||
|
||||
#include "common/string.h"
|
||||
#include "miscadmin.h"
|
||||
#include "utils/memdebug.h"
|
||||
#include "utils/memutils.h"
|
||||
@@ -1089,7 +1088,7 @@ pnstrdup(const char *in, Size len)
|
||||
{
|
||||
char *out;
|
||||
|
||||
len = pg_strnlen(in, len);
|
||||
len = strnlen(in, len);
|
||||
|
||||
out = palloc(len + 1);
|
||||
memcpy(out, in, len);
|
||||
|
||||
Reference in New Issue
Block a user