diff options
| author | Bruce Momjian <bruce@momjian.us> | 2010-09-28 21:41:03 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2010-09-28 21:41:03 +0000 |
| commit | ddfa48776c7cb6117d09bef6b9ab9cda58084472 (patch) | |
| tree | 85126fc5c5d0431ad1438e78f5354cfb3aea305d /contrib/pg_upgrade/util.c | |
| parent | 0364ab8b26c105b94e45c9519400796c1439f1b1 (diff) | |
In pg_upgrade, properly handle oids > 2^31 by using strtoul() internally
rather than atol().
Per report from Brian Hirt
Diffstat (limited to 'contrib/pg_upgrade/util.c')
| -rw-r--r-- | contrib/pg_upgrade/util.c | 12 |
1 files changed, 12 insertions, 0 deletions
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); +} |
