thriftrw / thriftrw-go

A Thrift encoding code generator and library for Go
MIT License
101 stars 53 forks source link

idl: Fix parsing of hex integer values #560

Closed KarboniteKream closed 1 year ago

KarboniteKream commented 1 year ago

Parsing of integer values is done with strconv.ParseInt(), which currently fails when a value like 0x1234 is specified. This is because the method ignores the prefix when base is explicitly specified (reference).

This PR adjusts the parsing code to skip the first 2 characters of the value, if it starts with 0x.

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

KarboniteKream commented 1 year ago

Updated, thank you.

EDIT: Seems like there's a problem with subst in Makefile on L130, but it works fine locally 🤔