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

From Amul Sul
Subject Re: Cleanup: Replace sscanf with strtol/strtoul in snapmgr
Date
Msg-id CAAJ_b974KcAQ=XMBfw-iy2tnbwNk9YnSA5XcQctf7N0GUSDRQA@mail.gmail.com
Whole thread
In response to Re: Cleanup: Replace sscanf with strtol/strtoul in snapmgr  ("Tristan Partin" <tristan@partin.io>)
Responses Re: Cleanup: Replace sscanf with strtol/strtoul in snapmgr
List pgsql-hackers
On Mon, May 4, 2026 at 9:19 PM Tristan Partin <tristan@partin.io> wrote:
>
> On Mon Apr 20, 2026 at 12:07 AM CDT, Amul Sul wrote:
> The patch generally looks good. One comment:
>
> > @@ -1359,17 +1365,36 @@ parseVxidFromText(const char *prefix, char **s, const char *filename,
> >  {
> >         char       *ptr = *s;
> >         int                     prefixlen = strlen(prefix);
> > +       long            lval;
> > +       unsigned long ulval;
>
> Perhaps better variable names would be procNumber and
> localTransactionId.
>

Thanks, Andreas and Tristan, for the review !

I have renamed the variables as suggested but used the shorter forms
procno and xid instead of procNumber and localTransactionId. I also
applied similar changes to parseXidFromText (changing val to xid), but
kept val in parseIntFromText since it seems to be more appropriate for
a generic integer value.

Updated patch attached.

Regards,
Amul

Attachment

pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: [PATCH] Fix duplicate errmsg in ALTER TABLE SPLIT PARTITION
Next
From: Daniel Gustafsson
Date:
Subject: Re: Serverside SNI support in libpq