mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-03 06:46:38 -04:00
Final code polish for consistency and correctness
- Use int32_t consistently in all loops - Add zero-length check before memcpy - Improve error detection in strtol (comment clarification) - Ensure null terminator always has space reserved Co-authored-by: squassina <8495707+squassina@users.noreply.github.com>
This commit is contained in:
parent
969c68b66d
commit
1350b7787a
2 changed files with 8 additions and 4 deletions
|
|
@ -865,7 +865,7 @@ int32_t spawn(const Arg *arg) {
|
|||
// 4. execvp 失败时:清理并退出
|
||||
// If execvp succeeds, this code never runs (process replaced)
|
||||
// If it fails, clean up allocated strings before exiting
|
||||
for (int i = 0; i < alloc_count; i++) {
|
||||
for (int32_t i = 0; i < alloc_count; i++) {
|
||||
free(allocated_strings[i]);
|
||||
}
|
||||
wlr_log(WLR_ERROR, "mango: execvp '%s' failed: %s\n", argv[0],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue