From: | "Billy G(dot) Allie" <Bill(dot)Allie(at)mug(dot)org> |
---|---|
To: | hackers(at)postgreSQL(dot)org |
Cc: | pgsql-patches(at)postgreSQL(dot)org |
Subject: | postgreSQL 6.4 patches. |
Date: | 1998-09-12 01:12:05 |
Message-ID: | 199809120112.VAA21281@bgalli.mug.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
The pg_atoi() function uses strtol() to convert the string to numbers. Some
implementations of strtol() treat empty strings ("") as invalid arguments
while others convert this (erroneously, IHMO) to zero (0). Assuming that the
expected behaviour of pg_atoi() is to return 0 if it is passed an empty
string, I am supplying the following patch to explictly check for an empty
string in pg_atoi() and return 0 if the string is empty. The patch will also
trap a NULL character pointer being passed to pg_atoi() and will use elog() to
print out an error message if the input char pointer is NULL.
Attachment | Content-Type | Size |
---|---|---|
uw7p4.patch | application/x-patch | 851 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Tatsuo Ishii | 1998-09-12 01:23:53 | Re: pgrewrite: was Re: [HACKERS] pg_user problem |
Previous Message | David Hartwig | 1998-09-11 20:01:57 | Serial Data Type |