DIV-Games-Studio icon indicating copy to clipboard operation
DIV-Games-Studio copied to clipboard

Uninitialized value in net.c

Open jonvaldes opened this issue 8 years ago • 1 comments

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.

jonvaldes avatar Feb 08 '17 06:02 jonvaldes

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.

MikeDX avatar Feb 08 '17 20:02 MikeDX