Skip to content

Commit 6bb9d30

Browse files
committed
Fix compiler warning.
get_user_name returns const char *, but we were assigning the result to a char * variable.
1 parent 001a573 commit 6bb9d30

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

contrib/pg_upgrade/pg_upgrade.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ void check_pghost_envvar(void);
443443
/* util.c */
444444

445445
char *quote_identifier(const char *s);
446-
int get_user_info(char **user_name);
446+
int get_user_info(char **user_name_p);
447447
void check_ok(void);
448448
void
449449
report_status(eLogType type, const char *fmt,...)

contrib/pg_upgrade/util.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,10 @@ quote_identifier(const char *s)
205205
* get_user_info()
206206
*/
207207
int
208-
get_user_info(char **user_name)
208+
get_user_info(char **user_name_p)
209209
{
210210
int user_id;
211+
const char *user_name;
211212
char *errstr;
212213

213214
#ifndef WIN32
@@ -216,12 +217,12 @@ get_user_info(char **user_name)
216217
user_id = 1;
217218
#endif
218219

219-
*user_name = get_user_name(&errstr);
220-
if (!*user_name)
220+
user_name = get_user_name(&errstr);
221+
if (!user_name)
221222
pg_fatal("%s\n", errstr);
222223

223224
/* make a copy */
224-
*user_name = pg_strdup(*user_name);
225+
*user_name_p = pg_strdup(user_name);
225226

226227
return user_id;
227228
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy