[PATCH v3 03/31] str: Fix a few bugs in trailing_strtoln()