diff test/testiconv.c @ 3997:6a4f3a32c2e6 SDL-1.2

Fixed bug #349 Solaris doesn't support the LATIN1 character set alias.
author Sam Lantinga <slouken@libsdl.org>
date Wed, 04 Jul 2007 04:27:47 +0000
parents ff3322d66771
children
line wrap: on
line diff
--- a/test/testiconv.c	Tue Jul 03 09:53:26 2007 +0000
+++ b/test/testiconv.c	Wed Jul 04 04:27:47 2007 +0000
@@ -53,12 +53,16 @@
 		for ( i = 0; i < SDL_arraysize(formats); ++i ) {
 			test[0] = SDL_iconv_string(formats[i], "UCS-4", ucs4, len);
 			test[1] = SDL_iconv_string("UCS-4", formats[i], test[0], len);
-			if ( SDL_memcmp(test[1], ucs4, len) != 0 ) {
+			if ( !test[1] || SDL_memcmp(test[1], ucs4, len) != 0 ) {
 				fprintf(stderr, "FAIL: %s\n", formats[i]);
 				++errors;
 			}
-			SDL_free(test[0]);
-			SDL_free(test[1]);
+			if ( test[0] ) {
+				SDL_free(test[0]);
+			}
+			if ( test[1] ) {
+				SDL_free(test[1]);
+			}
 		}
 		test[0] = SDL_iconv_string("UTF-8", "UCS-4", ucs4, len);
 		SDL_free(ucs4);