Ventoy
Ventoy copied to clipboard
Add length check on command line input
My team and I were looking through the Ventoy source code using our AI-based source code anomaly detection tool, MP-CodeCheck, and found this line that, while currently functioning correctly, may benefit from a slight adjustment for the sake of maintainability: a check on the length of the input string argv[1] before checking its first two characters.
This way, a developer who may modify this line in the future, especially if the program checks for longer string prefixes, will be more likely to be conscious of valid string checking to avoid undefined behavior.
IMHO, the check is unnecessary because of short-circuiting in if statement.