Skip to content
Permalink
Browse files

Hah, standard stdio code crashed on the test case.

  • Loading branch information
slouken committed Feb 27, 2006
1 parent e6a4639 commit 1fd7c2ad9e68128d99e639d184aa8c7c1ebda9a0
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/file/SDL_rwops.c
@@ -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 */
@@ -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)

0 comments on commit 1fd7c2a

Please sign in to comment.