Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninitialized value in net.c #10

Open
jonvaldes opened this issue Feb 8, 2017 · 1 comment
Open

Uninitialized value in net.c #10

jonvaldes opened this issue Feb 8, 2017 · 1 comment

Comments

@jonvaldes
Copy link
Contributor

At this point in net.c, the variable num_games has never been initialized, and thus contains garbage: https://github.com/DIVGAMES/DIV-Games-Studio/blob/master/src/runtime/net.c#L546

Looking at the next lines suggests the solution would be to turn the if into something like this:

if (num_games=_net_get_games(game_id)) {

However, if we do that then the next if would never be executed?

Another option would be to initialize the variable to 0, 1, or whatever a sensible default value is.

@MikeDX
Copy link
Collaborator

MikeDX commented Feb 8, 2017

The netplay code is probably one of the weakest parts of DIV. it only ever worked with IPX, and that was always a bit fickle.

The current version using SDL_Net is also fairly poor, but sort of works.

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

No branches or pull requests

2 participants