summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/pg/pgpool/darwin-strchrnul.patch
blob: f645f9379aab95e6254e7610d81d8c5c051a3719 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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++;