char *convert_ucs2_to_utf8(xcb_char2b_t *text, size_t num_glyphs) {
/* Allocate the output buffer (UTF-8 is at most 4 bytes per glyph) */
size_t buffer_size = num_glyphs * 4 * sizeof(char) + 1;
- char *buffer = scalloc(buffer_size * sizeof(char));
+ char *buffer = scalloc(buffer_size);
/* We need to use an additional pointer, because iconv() modifies it */
char *output = buffer;
* returned. It has to be freed when done.
*
*/
-xcb_char2b_t *convert_utf8_to_ucs2(char *input, int *real_strlen) {
+xcb_char2b_t *convert_utf8_to_ucs2(char *input, size_t *real_strlen) {
/* Calculate the input buffer size (UTF-8 is strlen-safe) */
size_t input_size = strlen(input);