Commit 79c1a06
string/memmgr: address Copilot review feedback on #4360
furi/core/string.c (furi_string_cat_vprintf):
The retry condition used >= which fired one extra vsnprintf when the
formatted output fit exactly into the reserved capacity (NUL byte
included). vsnprintf only truncates when size + 1 > buffer; change
the predicate to match.
furi/core/memmgr.c (realloc):
Drop the unreachable NULL-guard around the copy/free. pvPortMalloc()
calls furi_check(pvReturn, ...) on OOM (memmgr_heap.c:466) and crashes
before returning, so p cannot be NULL after the call. The guard was
dead code; the "preserve allocation on OOM" behavior advertised in
the original commit message never actually triggered.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent f48d096 commit 79c1a06
2 files changed
Lines changed: 5 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| |||
0 commit comments