Hah, standard stdio code crashed on the test case.
authorSam Lantinga <slouken@libsdl.org>
Mon, 27 Feb 2006 22:14:40 +0000
changeset 1455f487bb150acc
parent 1454 07d2b0085ecd
child 1456 84de7511f79f
Hah, standard stdio code crashed on the test case.
src/file/SDL_rwops.c
     1.1 --- a/src/file/SDL_rwops.c	Mon Feb 27 21:17:12 2006 +0000
     1.2 +++ b/src/file/SDL_rwops.c	Mon Feb 27 22:14:40 2006 +0000
     1.3 @@ -44,7 +44,7 @@
     1.4  	DWORD	must_exist, truncate;
     1.5  	int		a_mode;
     1.6  
     1.7 -	if (!context || !filename || !mode)
     1.8 +	if (!context)
     1.9  		return -1;
    1.10  		
    1.11  	context->hidden.win32io.h = INVALID_HANDLE_VALUE; /* mark this as unusable */
    1.12 @@ -336,6 +336,11 @@
    1.13  {
    1.14  	SDL_RWops *rwops = NULL;
    1.15  
    1.16 +	if ( !file || !*file || !mode || !*mode ) {
    1.17 +		SDL_SetError("SDL_RWFromFile(): No file or no mode specified");
    1.18 +		return NULL;
    1.19 +	}
    1.20 +
    1.21  #ifdef __WIN32__
    1.22  	rwops = SDL_AllocRW();
    1.23  	if (!rwops)