Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6bb9d30

Browse files
committed
Fix compiler warning.
get_user_name returns const char *, but we were assigning the resultto a char * variable.
1 parent001a573 commit6bb9d30

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 @@ voidcheck_pghost_envvar(void);
443443
/* util.c */
444444

445445
char*quote_identifier(constchar*s);
446-
intget_user_info(char**user_name);
446+
intget_user_info(char**user_name_p);
447447
voidcheck_ok(void);
448448
void
449449
report_status(eLogTypetype,constchar*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
intuser_id;
211+
constchar*user_name;
211212
char*errstr;
212213

213214
#ifndefWIN32
@@ -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
returnuser_id;
227228
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp