ospf6d: only allow positive time strings#21928
Conversation
Set the number of seconds to 0 if it is negative. Signed-off-by: Jeremie Leska <jeremie.leska@6wind.com>
Greptile SummaryThis PR fixes the
Confidence Score: 5/5The change is safe to merge — it adds a one-line negative-value guard inside a well-contained macro block with no side effects on callers. The fix is minimal and narrowly scoped: a No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["timerstring(tv, buf, size)"] --> B["_sec = tv->tv_sec"]
B --> C{_sec < 0?}
C -- Yes --> D["_sec = 0"]
C -- No --> E{_sec / 60 / 60 / 24 != 0?}
D --> E
E -- Yes --> F["snprintf: Dd HH:MM:SS"]
E -- No --> G["snprintf: HH:MM:SS"]
Reviews (1): Last reviewed commit: "ospf6d: only allow positive time strings" | Re-trigger Greptile |
Set the number of seconds to 0 if it is negative.