diff src/stdlib/SDL_getenv.c @ 1336:3692456e7b0f

Use SDL_ prefixed versions of C library functions. FIXME: Change #include <stdlib.h> to #include "SDL_stdlib.h" Change #include <string.h> to #include "SDL_string.h" Make sure nothing else broke because of this...
author Sam Lantinga <slouken@libsdl.org>
date Tue, 07 Feb 2006 06:59:48 +0000
parents 1cbaeee565b1
children d02b552e5304
line wrap: on
line diff
--- a/src/stdlib/SDL_getenv.c	Mon Feb 06 17:28:04 2006 +0000
+++ b/src/stdlib/SDL_getenv.c	Tue Feb 07 06:59:48 2006 +0000
@@ -42,20 +42,20 @@
 	char *value;
 	const char *sep;
 
-	sep = strchr(variable, '=');
+	sep = SDL_strchr(variable, '=');
 	if ( sep == NULL ) {
 		return -1;
 	}
-	bufferlen = strlen(variable)+1;
+	bufferlen = SDL_strlen(variable)+1;
 	if ( bufferlen > SDL_envmemlen ) {
-		char *newmem = (char *)realloc(SDL_envmem, bufferlen);
+		char *newmem = (char *)SDL_realloc(SDL_envmem, bufferlen);
 		if ( newmem == NULL ) {
 			return -1;
 		}
 		SDL_envmem = newmem;
 		SDL_envmemlen = bufferlen;
 	}
-	strcpy(SDL_envmem, variable);
+	SDL_strcpy(SDL_envmem, variable);
 	value = SDL_envmem + (sep - variable);
 	*value++ = '\0';
 	if ( !SetEnvironmentVariable(SDL_envmem, *value ? value : NULL) ) {
@@ -74,7 +74,7 @@
 		return NULL;
 	}
 	if ( bufferlen > SDL_envmemlen ) {
-		char *newmem = (char *)realloc(SDL_envmem, bufferlen);
+		char *newmem = (char *)SDL_realloc(SDL_envmem, bufferlen);
 		if ( newmem == NULL ) {
 			return NULL;
 		}
@@ -140,7 +140,7 @@
 
 	/* Didn't find it in the environment, expand and add */
 	if ( ! added ) {
-		new_env = realloc(SDL_env, (i+2)*sizeof(char *));
+		new_env = SDL_realloc(SDL_env, (i+2)*sizeof(char *));
 		if ( new_env ) {
 			SDL_env = new_env;
 			SDL_env[i++] = new_variable;