From ddfa48776c7cb6117d09bef6b9ab9cda58084472 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 28 Sep 2010 21:41:03 +0000 Subject: In pg_upgrade, properly handle oids > 2^31 by using strtoul() internally rather than atol(). Per report from Brian Hirt --- contrib/pg_upgrade/util.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'contrib/pg_upgrade/util.c') diff --git a/contrib/pg_upgrade/util.c b/contrib/pg_upgrade/util.c index 24fc08ef708..8ee39be03ed 100644 --- a/contrib/pg_upgrade/util.c +++ b/contrib/pg_upgrade/util.c @@ -259,3 +259,15 @@ getErrorText(int errNum) #endif return strdup(strerror(errNum)); } + + +/* + * str2uint() + * + * convert string to oid + */ +unsigned int +str2uint(const char *str) +{ + return strtol(str, NULL, 10); +} -- cgit v1.2.3