summaryrefslogtreecommitdiff
path: root/src/port/snprintf.c
diff options
context:
space:
mode:
authorAndres Freund2017-10-10 21:42:16 +0000
committerAndres Freund2017-10-10 21:50:30 +0000
commitfffd651e83ccbd6191a76be6ec7c6b1b27888fde (patch)
tree1c7f61fd5dfa8e540f2e27c1063ba9f8038370ba /src/port/snprintf.c
parentfa5e119dc71ada8d023deadcb36dbfae328f8902 (diff)
Rewrite strnlen replacement implementation from 8a241792f96.
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/[email protected]
Diffstat (limited to 'src/port/snprintf.c')
-rw-r--r--src/port/snprintf.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/port/snprintf.c b/src/port/snprintf.c
index 531d2c5ee35..43c17e702e2 100644
--- a/src/port/snprintf.c
+++ b/src/port/snprintf.c
@@ -43,8 +43,6 @@
#endif
#include <sys/param.h>
-#include "common/string.h"
-
#ifndef NL_ARGMAX
#define NL_ARGMAX 16
#endif
@@ -804,7 +802,7 @@ fmtstr(char *value, int leftjust, int minlen, int maxwidth,
* than that.
*/
if (pointflag)
- vallen = pg_strnlen(value, maxwidth);
+ vallen = strnlen(value, maxwidth);
else
vallen = strlen(value);