浏览代码

text-freetype2: Fix serialized variable size

This variable needs to be the same size for both architectures.  size_t
is 8 on 64bit and 4 on 32bit.
jp9000 10 年之前
父节点
当前提交
bdfb52410c
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      plugins/text-freetype2/find-font.c

+ 2 - 2
plugins/text-freetype2/find-font.c

@@ -22,7 +22,7 @@ static inline bool write_data(struct serializer *s, const void *data,
 
 static bool read_str(struct serializer *s, char **p_str)
 {
-	size_t size;
+	uint32_t size;
 	char *str;
 
 	if (!read_var(s, size))
@@ -41,7 +41,7 @@ static bool read_str(struct serializer *s, char **p_str)
 
 static bool write_str(struct serializer *s, const char *str)
 {
-	size_t size = str ? strlen(str) : 0;
+	uint32_t size = (uint32_t)(str ? strlen(str) : 0);
 
 	if (!write_var(s, size))
 		return false;