diff options
Diffstat (limited to 'src/steering_wheel_json.c')
-rw-r--r-- | src/steering_wheel_json.c | 8 |
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); |