mirror of
https://github.com/felt/tippecanoe.git
synced 2026-11-22 08:21:17 +01:00
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
This commit is contained in:
+10
-3
@@ -1,9 +1,16 @@
|
||||
# 2.82.1
|
||||
|
||||
* Fix `--use-attribute-for-id` rejecting an attribute value of 0 as a
|
||||
"too-large" feature ID. The leading-zero stripping used to check that the ID
|
||||
round-tripped stripped "0" down to an empty string, so the feature was left
|
||||
with no ID and kept the attribute instead.
|
||||
"too-large" feature ID. The check that an ID round-trips through `strtoull`
|
||||
stripped all leading zeroes, turning "0" into an empty string, so the
|
||||
feature was left with no ID and kept the attribute instead. (#421)
|
||||
* Fix `--use-attribute-for-id` turning a negative attribute value into a huge
|
||||
feature ID (-1 became 18446744073709551615). Negative values now warn and
|
||||
stay attributes, as negative top-level IDs already did. (#421)
|
||||
* Fix `--use-attribute-for-id` rejecting 18446744073709551615, the largest
|
||||
feature ID that can be represented, as "too-large". (#421)
|
||||
* Fix `--use-attribute-for-id` with `-aI` warning that an empty string was a
|
||||
"too-large" feature ID; it is now reported as not a number. (#421)
|
||||
|
||||
# 2.82.0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user