From: Robert Haas Date: Wed, 18 Dec 2013 18:31:35 +0000 (-0500) Subject: Fix compiler warning. X-Git-Tag: REL9_4_BETA1~773 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6bb9d3017c173fa6102010d83ced7ad4409e5a49;p=postgresql Fix compiler warning. get_user_name returns const char *, but we were assigning the result to a char * variable. --- diff --git a/contrib/pg_upgrade/pg_upgrade.h b/contrib/pg_upgrade/pg_upgrade.h index d25ac37a15..938bb870b4 100644 --- a/contrib/pg_upgrade/pg_upgrade.h +++ b/contrib/pg_upgrade/pg_upgrade.h @@ -443,7 +443,7 @@ void check_pghost_envvar(void); /* util.c */ char *quote_identifier(const char *s); -int get_user_info(char **user_name); +int get_user_info(char **user_name_p); void check_ok(void); void report_status(eLogType type, const char *fmt,...) diff --git a/contrib/pg_upgrade/util.c b/contrib/pg_upgrade/util.c index c3d45237fd..a7a48d782b 100644 --- a/contrib/pg_upgrade/util.c +++ b/contrib/pg_upgrade/util.c @@ -205,9 +205,10 @@ quote_identifier(const char *s) * get_user_info() */ int -get_user_info(char **user_name) +get_user_info(char **user_name_p) { int user_id; + const char *user_name; char *errstr; #ifndef WIN32 @@ -216,12 +217,12 @@ get_user_info(char **user_name) user_id = 1; #endif - *user_name = get_user_name(&errstr); - if (!*user_name) + user_name = get_user_name(&errstr); + if (!user_name) pg_fatal("%s\n", errstr); /* make a copy */ - *user_name = pg_strdup(*user_name); + *user_name_p = pg_strdup(user_name); return user_id; }