Skip to content

Fixed wrong index incrementing while parsing strings#5

Merged
LucHeart merged 1 commit intoLucHeart:masterfrom
kafeijao:fix/wrong-index-incrementing-while-parsing-strings
Sep 8, 2025
Merged

Fixed wrong index incrementing while parsing strings#5
LucHeart merged 1 commit intoLucHeart:masterfrom
kafeijao:fix/wrong-index-incrementing-while-parsing-strings

Conversation

@kafeijao
Copy link

@kafeijao kafeijao commented Sep 8, 2025

No description provided.

@LucHeart LucHeart requested review from LucHeart and Copilot September 8, 2025 15:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an index incrementing bug in string parsing for OSC (Open Sound Control) packets. The issue was that the string parsing method didn't correctly advance the index after reading a string, leading to parsing errors.

  • Modified GetString method to return the new index position via an out parameter
  • Updated string and symbol parsing logic to use the corrected index advancement
  • Added comprehensive test coverage for string padding scenarios

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
CoreOSC/OscPacketUtils.cs Added out int newIndex parameter to GetString method to properly track parsing position
CoreOSC/OscMessage.cs Updated string and symbol parsing to use the corrected index from GetString method
CoreOSC.Tests/ParseTest.cs Added new test case to verify correct string parsing with various padding scenarios
CoreOSC.Tests/ParseTest.TestStringPadding.verified.txt Expected test output for the new string padding test

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.

3 participants