utils: Fix invalid month 00 in development SPL date
The development SPL month is computed as (current_month + 3) % 12,
followed by a quarterly round-up guarded by (month % 3 > 0). In
September the intermediate value is (9 + 3) % 12 == 0, and since
0 % 3 == 0 the round-up is skipped, leaving the month at 0. printf
then emits an invalid date such as "2027-00-05".
Use a 1-based wrap-around ((month - 1 + 3) % 12 + 1) so the result
always lands in the 1..12 range instead of wrapping to 0. This yields
a valid December date for September builds and leaves every other
month unchanged.
Bug: 556789083
Change-Id: Iee5441907422e6eef74301313d4b109ad4fc7dec
Signed-off-by: Zhipeng Wang <[email protected]>
(cherry picked from commit 5877a40116cd6d60c873dea521e532e65e9da8fd)
1 file changed