ANSI C fix (all variables need to be defined at start of block). SDL-1.2
authorRyan C. Gordon <icculus@icculus.org>
Sat, 01 Sep 2007 17:25:24 +0000
branchSDL-1.2
changeset 4094 ca992789c798
parent 4093 7ea10b80eda3
child 4095 f733c048a94f
ANSI C fix (all variables need to be defined at start of block). Fixes Bugzilla #487.
src/video/x11/SDL_x11events.c
--- a/src/video/x11/SDL_x11events.c	Tue Aug 21 06:52:33 2007 +0000
+++ b/src/video/x11/SDL_x11events.c	Sat Sep 01 17:25:24 2007 +0000
@@ -235,11 +235,11 @@
     Uint8 const *const end_of_input = utf8 + utf8_length - 1;
 
     while (utf8 <= end_of_input) {
+	Uint8 const c = *utf8;
 	if (p >= max_ptr) {
 	    /* No more output space.  */
 	    return -1;
 	}
-	Uint8 const c = *utf8;
 	if (c < 0x80) {
 	    /* One byte ASCII.  */
 	    *p++ = c;