src/main/win32/SDL_win32_main.c
changeset 1465 8dfa9a6d69a5
parent 1433 bb6839704ed6
child 1472 4aac8563c296
     1.1 --- a/src/main/win32/SDL_win32_main.c	Sat Mar 04 05:13:03 2006 +0000
     1.2 +++ b/src/main/win32/SDL_win32_main.c	Sat Mar 04 08:24:35 2006 +0000
     1.3 @@ -51,27 +51,6 @@
     1.4  #if defined(_WIN32_WCE) && _WIN32_WCE < 300
     1.5  /* seems to be undefined in Win CE although in online help */
     1.6  #define isspace(a) (((CHAR)a == ' ') || ((CHAR)a == '\t'))
     1.7 -
     1.8 -/* seems to be undefined in Win CE although in online help */
     1.9 -char *SDL_strrchr(char *str, int c)
    1.10 -{
    1.11 -	char *p;
    1.12 -
    1.13 -	/* Skip to the end of the string */
    1.14 -	p=str;
    1.15 -	while (*p)
    1.16 -		p++;
    1.17 -
    1.18 -	/* Look for the given character */
    1.19 -	while ( (p >= str) && (*p != (CHAR)c) )
    1.20 -		p--;
    1.21 -
    1.22 -	/* Return NULL if character not found */
    1.23 -	if ( p < str ) {
    1.24 -		p = NULL;
    1.25 -	}
    1.26 -	return p;
    1.27 -}
    1.28  #endif /* _WIN32_WCE < 300 */
    1.29  
    1.30  /* Parse a command line buffer into arguments */
    1.31 @@ -281,8 +260,13 @@
    1.32  	}
    1.33  	path[pathlen] = '\0';
    1.34  
    1.35 +#ifdef _WIN32_WCE
    1.36 +	wcsncpy( stdoutPath, path, SDL_arraysize(stdoutPath) );
    1.37 +	wcsncat( stdoutPath, DIR_SEPERATOR STDOUT_FILE, SDL_arraysize(stdoutPath) );
    1.38 +#else
    1.39  	SDL_strlcpy( stdoutPath, path, SDL_arraysize(stdoutPath) );
    1.40  	SDL_strlcat( stdoutPath, DIR_SEPERATOR STDOUT_FILE, SDL_arraysize(stdoutPath) );
    1.41 +#endif
    1.42      
    1.43  	/* Redirect standard input and standard output */
    1.44  	newfp = freopen(stdoutPath, TEXT("w"), stdout);
    1.45 @@ -300,8 +284,13 @@
    1.46  	}
    1.47  #endif /* _WIN32_WCE */
    1.48  
    1.49 +#ifdef _WIN32_WCE
    1.50 +	wcsncpy( stderrPath, path, SDL_arraysize(stdoutPath) );
    1.51 +	wcsncat( stderrPath, DIR_SEPERATOR STDOUT_FILE, SDL_arraysize(stdoutPath) );
    1.52 +#else
    1.53  	SDL_strlcpy( stderrPath, path, SDL_arraysize(stderrPath) );
    1.54  	SDL_strlcat( stderrPath, DIR_SEPERATOR STDERR_FILE, SDL_arraysize(stderrPath) );
    1.55 +#endif
    1.56  
    1.57  	newfp = freopen(stderrPath, TEXT("w"), stderr);
    1.58  #ifndef _WIN32_WCE
    1.59 @@ -329,7 +318,7 @@
    1.60  	wcscpy (bufp+wcslen(bufp), TEXT("\" "));
    1.61  	wcsncpy(bufp+wcslen(bufp), szCmdLine,nLen-wcslen(bufp));
    1.62  	nLen = wcslen(bufp)+1;
    1.63 -	cmdline = SDL_stack_alloc(wchar_t, nLen);
    1.64 +	cmdline = SDL_stack_alloc(char, nLen);
    1.65  	if ( cmdline == NULL ) {
    1.66  		return OutOfMemory();
    1.67  	}