mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +03:00
Fix function name.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.171 2005/08/13 01:34:30 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.172 2005/08/23 20:45:07 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -2156,25 +2156,16 @@ PQoidValue(const PGresult *res)
|
||||
char *endptr = NULL;
|
||||
unsigned long result;
|
||||
|
||||
if (!res || !res->cmdStatus || strncmp(res->cmdStatus, "INSERT ", 7) != 0)
|
||||
if (!res ||
|
||||
!res->cmdStatus ||
|
||||
strncmp(res->cmdStatus, "INSERT ", 7) != 0 ||
|
||||
res->cmdStatus[7] < '0' ||
|
||||
res->cmdStatus[7] > '9')
|
||||
return InvalidOid;
|
||||
|
||||
#ifdef WIN32
|
||||
SetLastError(0);
|
||||
#else
|
||||
errno = 0;
|
||||
#endif
|
||||
result = strtoul(res->cmdStatus + 7, &endptr, 10);
|
||||
|
||||
if (!endptr || (*endptr != ' ' && *endptr != '\0')
|
||||
#ifndef WIN32
|
||||
/*
|
||||
* On WIN32, errno is not thread-safe and GetLastError() isn't set by
|
||||
* strtoul(), so we can't check on this platform.
|
||||
*/
|
||||
|| errno == ERANGE
|
||||
#endif
|
||||
)
|
||||
if (!endptr || (*endptr != ' ' && *endptr != '\0'))
|
||||
return InvalidOid;
|
||||
else
|
||||
return (Oid) result;
|
||||
|
Reference in New Issue
Block a user