diff --git a/src/bin/pg_upgrade/controldata.c b/src/bin/pg_upgrade/controldata.c index fd772ba4f38..8c69329805b 100644 --- a/src/bin/pg_upgrade/controldata.c +++ b/src/bin/pg_upgrade/controldata.c @@ -352,7 +352,7 @@ get_control_data(ClusterInfo *cluster) pg_fatal("%d: controldata retrieval problem", __LINE__); p++; /* remove ':' char */ - cluster->controldata.chkpnt_nxtmxoff = str2uint(p); + cluster->controldata.chkpnt_nxtmxoff = str2uint64(p); got_mxoff = true; } else if ((p = strstr(bufin, "First log segment after reset:")) != NULL) diff --git a/src/bin/pg_upgrade/pg_upgrade.h b/src/bin/pg_upgrade/pg_upgrade.h index ccd1ac0d013..92607daace5 100644 --- a/src/bin/pg_upgrade/pg_upgrade.h +++ b/src/bin/pg_upgrade/pg_upgrade.h @@ -496,6 +496,7 @@ void cleanup_output_dirs(void); void prep_status(const char *fmt, ...) pg_attribute_printf(1, 2); void prep_status_progress(const char *fmt, ...) pg_attribute_printf(1, 2); unsigned int str2uint(const char *str); +uint64 str2uint64(const char *str); /* version.c */ diff --git a/src/bin/pg_upgrade/util.c b/src/bin/pg_upgrade/util.c index 08d6385b512..e7d7ab56445 100644 --- a/src/bin/pg_upgrade/util.c +++ b/src/bin/pg_upgrade/util.c @@ -353,3 +353,14 @@ str2uint(const char *str) { return strtoul(str, NULL, 10); } + +/* + * str2uint64() + * + * convert string to uint64 + */ +uint64 +str2uint64(const char *str) +{ + return strtou64(str, NULL, 10); +}