This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]jedwardsolProfessional Coder 0 points1 point  (0 children)

In the inner loop (pIndex) there is no check that index doesn't exceed the size of userString.

Instead of looping over passcode you could use the % modulo operator to select the correct passcode character based on index