Skip to content

Fix stringToWide sizing, main signature, and timeout fallback#102

Merged
Easton97-Jens merged 2 commits into
v3/master_pr3489from
codex/fix-github-review-comments-in-pr
Apr 25, 2026
Merged

Fix stringToWide sizing, main signature, and timeout fallback#102
Easton97-Jens merged 2 commits into
v3/master_pr3489from
codex/fix-github-review-comments-in-pr

Conversation

@Easton97-Jens

Copy link
Copy Markdown
Owner

Motivation

  • Prevent an off-by-one / buffer sizing risk in Windows UTF-8-to-wide conversion when using MultiByteToWideChar(); make the multithread example use a standards-compliant main signature; and make the stress test portable on systems missing the timeout utility.

Description

  • In src/operators/inspect_file.cc allocate needed wide characters, call MultiByteToWideChar() with capacity needed, verify the returned written count matches needed, and remove the trailing null via pop_back() to preserve previous behavior while fixing the sizing risk.
  • In examples/multithread/multithread.cc change the program entry signature from int main(int argc, const char *argv[]) to int main(int argc, char *argv[]) without changing how arguments are used.
  • In test/stress/inspectfile_multithread_stress.sh keep using timeout exactly as before when available, and otherwise print a clear warning and run the same command without timeout.

Testing

  • Ran git diff --check which completed with no issues detected.
  • Performed a shell syntax check sh -n test/stress/inspectfile_multithread_stress.sh which succeeded.

Codex Task

@Easton97-Jens Easton97-Jens merged commit f1d87f6 into v3/master_pr3489 Apr 25, 2026
0 of 192 checks passed
@Easton97-Jens Easton97-Jens deleted the codex/fix-github-review-comments-in-pr branch April 25, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant