you're not checking that it correctly converted - you need to pass in the error pointer and check it after return to ensure you correctly parsed a value.