Commit Graph
5 Commits
Author SHA1 Message Date
Claude e7a2c6ac49 Reject negative attribute IDs and accept the largest unsigned one
--use-attribute-for-id parsed the attribute with strtoull() into a
signed long long. strtoull() wraps "-1" around to ULLONG_MAX, which
std::to_string() then printed back as "-1", so the round-trip check
passed and the feature got the ID 18446744073709551615. The same
signedness made the genuine value 18446744073709551615 print as "-1"
and be rejected as too large.

Store the ID as unsigned long long, and reject values that start with
'-' with the same "negative feature ID" warning used for top-level IDs.
Also require the value to start with a digit, so an empty string (or
one with leading whitespace or '+') is reported as not a number instead
of as a too-large ID.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CQ6vQTWcgZdZ5kwoNa4bxA
2026-11-11 19:44:22 +00:00
Claude 0dd272824d Accept 0 as a feature ID in --use-attribute-for-id
strip_zeroes() removed every leading zero, so "0" became "" and never
matched std::to_string(0). The ID was rejected as too large and the
feature was left without an ID. Keep the final digit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172RxhnHkNgRZ3NBrsRJZYK
2026-09-26 17:33:51 +00:00
Eric Fischer f9c9ff3853 Ignore leading zeroes when converting string attributes to feature IDs 2018-11-07 15:46:44 -08:00
Eric Fischer bd2423a5ea Add an option to use a specified feature attribute as the feature ID 2018-11-02 15:21:52 -07:00
Eric Fischer 53de8a2014 Add an option to convert stringified number feature IDs to numbers 2018-11-01 17:07:33 -07:00