Skip to content

Trivial fix: initialize argi in tsfile.c - #146

Merged
throwaway96 merged 1 commit into
openlgtv:masterfrom
throwaway96:fix-tsfile-init-argi-20260805
Aug 5, 2026
Merged

throwaway96 merged 1 commit into
openlgtv:masterfrom
throwaway96:fix-tsfile-init-argi-20260805

Conversation

@throwaway96

@throwaway96 throwaway96 commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

In tsfile.c, the positional argument index (argi) was not initialized before use.

Really, int argi could be replaced with a bool. But I suppose this preserves flexibility in case more positional arguments are added.

Initialize positional argument index to zero.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an uninitialized local variable in src/tools/tsfile.c that tracks the positional (non-flag) argument index, preventing undefined behavior when parsing command-line arguments for the tsfile tool.

Changes:

  • Initialize argi to 0 before it is used in switch(argi++) while parsing positional arguments.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@throwaway96
throwaway96 merged commit e914f0b into openlgtv:master Aug 5, 2026
1 check failed
@throwaway96
throwaway96 deleted the fix-tsfile-init-argi-20260805 branch August 5, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants