Skip to content

Commit 7e94990

Browse files
committed
fixes
1 parent 975d2bb commit 7e94990

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Simple Makefile for zxlib tests
22
# Wrapper around CMake build system
33

4-
.PHONY: all build test clean test-verbose test-filter fuzz fuzz_crash fuzz_clean build_fuzz format
4+
.PHONY: all build test clean test-verbose test-filter fuzz fuzz_crash fuzz_clean build_fuzz fuzz_report fuzz_report_html fuzz_help format
55

66
# Default target
77
all: build

include/zxformat.h

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extern "C" {
4545
tmp = number % 10; \
4646
tmp = tmp < 0 ? -tmp : tmp; \
4747
*(p++) = (char)('0' + tmp); \
48-
number /= 10u; \
48+
number /= 10; \
4949
} \
5050
while (p > data) { \
5151
p--; \
@@ -160,6 +160,13 @@ __Z_INLINE uint64_t parse_digits_to_uint64(const char *start, const char *end, u
160160
}
161161

162162
__Z_INLINE int8_t str_to_int8(const char *start, const char *end, char *error) {
163+
if (start > end) {
164+
if (error != NULL) {
165+
*error = 1;
166+
}
167+
return 0;
168+
}
169+
163170
int sign = 1;
164171
if (*start == '-') {
165172
sign = -1;
@@ -195,6 +202,13 @@ __Z_INLINE int8_t str_to_int8(const char *start, const char *end, char *error) {
195202
}
196203

197204
__Z_INLINE int64_t str_to_int64(const char *start, const char *end, char *error) {
205+
if (start > end) {
206+
if (error != NULL) {
207+
*error = 1;
208+
}
209+
return 0;
210+
}
211+
198212
int sign = 1;
199213
if (*start == '-') {
200214
sign = -1;
@@ -485,7 +499,7 @@ __Z_INLINE zxerr_t formatBufferData(const uint8_t *ptr, uint64_t len, char *outV
485499
uint8_t pageIdx, uint8_t *pageCount) {
486500
char bufferUI[500 + 1];
487501
MEMZERO(bufferUI, sizeof(bufferUI));
488-
MEMZERO(outValue, 0);
502+
MEMZERO(outValue, outValueLen);
489503
CHECK_APP_CANARY()
490504

491505
if (len >= sizeof(bufferUI)) {

0 commit comments

Comments
 (0)