diff src/loadso/dlopen/SDL_sysloadso.c @ 1379:c0a74f199ecf

Use only safe string functions
author Sam Lantinga <slouken@libsdl.org>
date Sun, 19 Feb 2006 23:46:34 +0000
parents 19418e4422cb
children d910939febfa
line wrap: on
line diff
--- a/src/loadso/dlopen/SDL_sysloadso.c	Sun Feb 19 23:38:57 2006 +0000
+++ b/src/loadso/dlopen/SDL_sysloadso.c	Sun Feb 19 23:46:34 2006 +0000
@@ -42,9 +42,10 @@
 {
 	void *symbol = dlsym(handle, name);
 	if ( symbol == NULL ) {
-		char *_name = SDL_stack_alloc(char, 1+SDL_strlen(name)+1);
+		size_t len = 1+SDL_strlen(name)+1;
+		char *_name = SDL_stack_alloc(char, len);
 		_name[0] = '_';
-		SDL_strcpy(&_name[1], name);
+		SDL_strlcpy(&_name[1], name, len);
 		symbol = dlsym(handle, name);
 		SDL_stack_free(_name);
 		if ( symbol == NULL ) {