src/video/haiku/SDL_bclipboard.cc
changeset 11039 d0e35a9ba1f6
parent 10992 57a9841b0259
child 11045 cf4e14eedfdf
equal deleted inserted replaced
11038:b2883845e32c 11039:d0e35a9ba1f6
    67 	
    67 	
    68 	if (!text) {
    68 	if (!text) {
    69 		result = SDL_strdup("");
    69 		result = SDL_strdup("");
    70 	} else {
    70 	} else {
    71 		/* Copy the data and pass on to SDL */
    71 		/* Copy the data and pass on to SDL */
    72 		result = (char*)SDL_calloc(1, sizeof(char*)*length);
    72 		result = (char *)SDL_malloc((length + 1) * sizeof(char));
    73 		SDL_strlcpy(result, text, length);
    73 		SDL_strlcpy(result, text, length + 1);
    74 	}
    74 	}
    75 	
    75 	
    76 	return result;
    76 	return result;
    77 }
    77 }
    78 
    78