Skip to content

Commit

Permalink
Hah, standard stdio code crashed on the test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Feb 27, 2006
1 parent e6a4639 commit 1fd7c2a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/file/SDL_rwops.c
Expand Up @@ -44,7 +44,7 @@ static int win32_file_open(SDL_RWops *context, const char *filename, const char
DWORD must_exist, truncate;
int a_mode;

if (!context || !filename || !mode)
if (!context)
return -1;

context->hidden.win32io.h = INVALID_HANDLE_VALUE; /* mark this as unusable */
Expand Down Expand Up @@ -336,6 +336,11 @@ SDL_RWops *SDL_RWFromFile(const char *file, const char *mode)
{
SDL_RWops *rwops = NULL;

if ( !file || !*file || !mode || !*mode ) {
SDL_SetError("SDL_RWFromFile(): No file or no mode specified");
return NULL;
}

#ifdef __WIN32__
rwops = SDL_AllocRW();
if (!rwops)
Expand Down

0 comments on commit 1fd7c2a

Please sign in to comment.