aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/steering_wheel_json.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/steering_wheel_json.c b/src/steering_wheel_json.c
index 9d72284..4377a72 100644
--- a/src/steering_wheel_json.c
+++ b/src/steering_wheel_json.c
@@ -148,8 +148,8 @@ int wheel_define_init(const char *fname)
return -1;
}
- filebuf = (char *)malloc(stbuf.st_size);
- fread(filebuf, 1, stbuf.st_size, fp);
+ filebuf = (char *)malloc((size_t)stbuf.st_size);
+ fread(filebuf, 1, (size_t)stbuf.st_size, fp);
fclose(fp);
jobj = json_tokener_parse(filebuf);
@@ -274,8 +274,8 @@ int wheel_gear_para_init(const char *fname)
return -1;
}
- filebuf = (char*)malloc(stbuf.st_size);
- fread(filebuf, 1, stbuf.st_size, fp);
+ filebuf = (char*)malloc((size_t)stbuf.st_size);
+ fread(filebuf, 1, (size_t)stbuf.st_size, fp);
fclose(fp);
jobj = json_tokener_parse(filebuf);