diff options
author | kdx <kikoodx@paranoici.org> | 2023-08-17 02:50:23 +0200 |
---|---|---|
committer | kdx <kikoodx@paranoici.org> | 2023-08-17 03:03:54 +0200 |
commit | ada8e5fd4a6315bf3e6368862477353b1d13c3bb (patch) | |
tree | 1806ed4df5373d2c488b7f1f2d3732c1384a6273 | |
parent | af96c12cec84d1c78f8a641463a842f0ed3004d2 (diff) | |
download | tiled2c-ada8e5fd4a6315bf3e6368862477353b1d13c3bb.tar.gz |
prevent invisible overflow bug
cJSON caps int to their largest value, tiled uses unsigned int that
can go up to the uppest limit. using the 32 bits causes an overflow
when converting a 32 bit unsigned inter to a 32 bit integer...
you guess the rest
-rw-r--r-- | src/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -69,7 +69,7 @@ process_tilelayer(cJSON *json) printf(".tilelayer={(const unsigned int[]){"); cJSON *tile; cJSON_ArrayForEach(tile, data) - printf("%u,", tile->valueint); + printf("%u,", (unsigned)tile->valuedouble); printf("}}},"); return 0; |