IMG.c
changeset 11 b3d1b573a542
parent 7 e1b6443ffb6b
child 24 69f3d44d56da
     1.1 --- a/IMG.c	Thu Nov 30 04:04:21 2000 +0000
     1.2 +++ b/IMG.c	Wed Dec 06 18:00:38 2000 +0000
     1.3 @@ -67,7 +67,7 @@
     1.4  }
     1.5  
     1.6  /* Portable case-insensitive string compare function */
     1.7 -static int string_equals(const char *str1, const char *str2)
     1.8 +int IMG_string_equals(const char *str1, const char *str2)
     1.9  {
    1.10  	while ( *str1 && *str2 ) {
    1.11  		if ( toupper((unsigned char)*str1) !=
    1.12 @@ -99,11 +99,11 @@
    1.13  	/* Detect the type of image being loaded */
    1.14  	start = SDL_RWtell(src);
    1.15  	image = NULL;
    1.16 -	for ( i=0; i < ARRAYSIZE(supported) && !image; ++i ) {
    1.17 +	for ( i=0; i < ARRAYSIZE(supported); ++i ) {
    1.18  	        if( (supported[i].is
    1.19  		     && (SDL_RWseek(src, start, SEEK_SET),
    1.20  			 supported[i].is(src)))
    1.21 -		    || (type && string_equals(type, supported[i].type))) {
    1.22 +		    || (type && IMG_string_equals(type, supported[i].type))) {
    1.23  #ifdef DEBUG_IMGLIB
    1.24  			fprintf(stderr, "IMGLIB: Loading image as %s\n",
    1.25  							supported[i].type);
    1.26 @@ -118,7 +118,7 @@
    1.27  	if ( freesrc ) {
    1.28  		SDL_RWclose(src);
    1.29  	}
    1.30 -	if ( image == NULL ) {
    1.31 +	if ( i == ARRAYSIZE(supported) ) {
    1.32  		IMG_SetError("Unsupported image format");
    1.33  	}
    1.34  	return(image);