[GNC] Bad date not caught
john
jralls at ceridwen.us
Fri Oct 13 15:23:15 EDT 2023
> On Oct 13, 2023, at 11:32, David G. Pickett via gnucash-user <gnucash-user at gnucash.org> wrote:
>
> String to date parsers provide a way to tell if the entire string was not digested, see 'man strptime' that says it returns a pointer to where it stopped, should be at the end of the string.
They do, and adding that check is part of what I pushed yesterday: https://github.com/Gnucash/gnucash/commit/44c278a82c692b5b591eccaf052952b3cd248084
But the rest of that function is a bit goofy and regardless strptime is very fussy: If you tell it to parse the date with %m/%d/%Y and pass in--as Fred did--5.19.21--it will return NULL indicating that the parse failed. We can do much better.
Regards,
John Ralls
More information about the gnucash-user
mailing list