src/video/x11/SDL_x11mouse.c
changeset 1379 c0a74f199ecf
parent 1361 19418e4422cb
child 1402 d910939febfa
     1.1 --- a/src/video/x11/SDL_x11mouse.c	Sun Feb 19 23:38:57 2006 +0000
     1.2 +++ b/src/video/x11/SDL_x11mouse.c	Sun Feb 19 23:46:34 2006 +0000
     1.3 @@ -191,14 +191,16 @@
     1.4  static void SetMouseAccel(_THIS, const char *accel_param)
     1.5  {
     1.6  	int i;
     1.7 +	size_t len;
     1.8  	int accel_value[3];
     1.9  	char *mouse_param, *mouse_param_buf, *pin;
    1.10  
    1.11 -	mouse_param_buf = (char *)SDL_malloc(SDL_strlen(accel_param)+1);
    1.12 +	len = SDL_strlen(accel_param)+1;
    1.13 +	mouse_param_buf = SDL_stack_alloc(char, len);
    1.14  	if ( ! mouse_param_buf ) {
    1.15  		return;
    1.16  	}
    1.17 -	SDL_strcpy(mouse_param_buf, accel_param);
    1.18 +	SDL_strlcpy(mouse_param_buf, accel_param, len);
    1.19  	mouse_param = mouse_param_buf;
    1.20  
    1.21  	for ( i=0; (i < 3) && mouse_param; ++i ) {