Skip to content

Commit

Permalink
Fixed bug with IMG_Init() return value.
Browse files Browse the repository at this point in the history
Luke J Crook to sdl

The documentation for IMG_Init states: "You may call this function with a 0 to
retrieve whether support was built-in or not loaded yet."

What does this statement mean? I had assumed this to mean that calling IMG_Init
(0) will return the current status of JPG, PNG or TIF support. However looking
at the source, IMG_Init(0) will always return 0 as `flags` is bitwise ANDed
with IMG_INIT_JPG/IMG_INIT_PNG/IMG_INIT_TIF.
  • Loading branch information
slouken committed Feb 13, 2011
1 parent 574562b commit e65b5a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion IMG.c
Expand Up @@ -90,7 +90,7 @@ int IMG_Init(int flags)
}
initialized |= result;

return (result);
return (initialized);
}

void IMG_Quit()
Expand Down

0 comments on commit e65b5a1

Please sign in to comment.