Files
nixpkgs/pkgs/by-name/pg/pgpool/darwin-strchrnul.patch

14 lines
674 B
Diff

diff --git a/src/utils/pool_process_reporting.c b/src/utils/pool_process_reporting.c
index 39087bc47..dc28ba958 100644
--- a/src/utils/pool_process_reporting.c
+++ b/src/utils/pool_process_reporting.c
@@ -1118,7 +1118,8 @@ get_config(int *nrows)
StrNCpy(status[i].name, "memqcache_stats_start_time", POOLCONFIG_MAXNAMELEN);
snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", ctime(&pool_get_memqcache_stats()->start_time));
/* remove a newline added by ctime() */
- *(strchrnul(status[i].value, '\n')) = '\0';
+ char *p = strchr(status[i].value, '\n');
+ if (p) *p = '\0';
StrNCpy(status[i].desc, "Start time of query cache stats", POOLCONFIG_MAXDESCLEN);
i++;