Hello,

Attached patch provides trivial simplification of the search of end of
the argv[] area by replacing for() loop with calculation based on
argc.
diff --git a/src/backend/utils/misc/ps_status.c b/src/backend/utils/misc/ps_status.c
index 892a810..d8f2105 100644
--- a/src/backend/utils/misc/ps_status.c
+++ b/src/backend/utils/misc/ps_status.c
@@ -134,11 +134,8 @@ save_ps_display_args(int argc, char **argv)
 		/*
 		 * check for contiguous argv strings
 		 */
-		for (i = 0; i < argc; i++)
-		{
-			if (i == 0 || end_of_area + 1 == argv[i])
-				end_of_area = argv[i] + strlen(argv[i]);
-		}
+		if (argc)
+			end_of_area = argv[argc - 1] + strlen(argv[argc - 1]);
 
 		if (end_of_area == NULL)	/* probably can't happen? */
 		{
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to