src/video/haiku/SDL_bclipboard.cc
changeset 11039 d0e35a9ba1f6
parent 10992 57a9841b0259
child 11045 cf4e14eedfdf
     1.1 --- a/src/video/haiku/SDL_bclipboard.cc	Sat May 27 23:30:07 2017 +0200
     1.2 +++ b/src/video/haiku/SDL_bclipboard.cc	Sat May 27 23:30:21 2017 +0200
     1.3 @@ -69,8 +69,8 @@
     1.4  		result = SDL_strdup("");
     1.5  	} else {
     1.6  		/* Copy the data and pass on to SDL */
     1.7 -		result = (char*)SDL_calloc(1, sizeof(char*)*length);
     1.8 -		SDL_strlcpy(result, text, length);
     1.9 +		result = (char *)SDL_malloc((length + 1) * sizeof(char));
    1.10 +		SDL_strlcpy(result, text, length + 1);
    1.11  	}
    1.12  	
    1.13  	return result;