Cleanup: Replace sscanf with strtol/strtoul in snapmgr - Mailing list pgsql-hackers

From Amul Sul
Subject Cleanup: Replace sscanf with strtol/strtoul in snapmgr
Date
Msg-id CAAJ_b97mG=6ybUYE8nQyDfKkhaxTCD8rE8s6L8efNmqHaUYNWQ@mail.gmail.com
Whole thread
List pgsql-hackers
Hi,

The attached patch replaces sscanf with strtol and strtoul in the
ImportSnapshot helpers (parseIntFromText, parseXidFromText, and
parseVxidFromText) to improve reliability and efficiency. By utilizing
the end pointer, we can locate the next line without re-scanning the
entire string.

Additionally, this change aligns the snapshot code with the rest of
the Postgres backend, which already favors these functions for safer
parsing.

--
Regards,
Amul Sul
EDB: http://www.enterprisedb.com

Attachment

pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: EXCEPT TABLE - Case inconsistency for describe \d and \dRp+
Next
From: Richard Guo
Date:
Subject: Re: Bug: Rule actions see wrong values for generated columns (NEW.gen reads OLD value)