fixed compiler warning:
findlongest.c:101:28: error: argument 1 value ‘2147483648’ exceeds maximum object size 2147483647 [-Werror=alloc-size-larger-than=]
101 | uint8_t *stringsSeen = calloc((uint64_t)1 << (MAX_STRING_SIZE-3u), sizeof(uint8_t));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
2
software/tools/findlongest.c
Normal file → Executable file
2
software/tools/findlongest.c
Normal file → Executable file
@@ -98,7 +98,7 @@ int main(int argc, char **argv) {
|
||||
} else {
|
||||
data = readDataFromFile(argv[1], &dataLen);
|
||||
}
|
||||
uint8_t *stringsSeen = calloc((uint64_t)1 << (MAX_STRING_SIZE-3u), sizeof(uint8_t));
|
||||
uint8_t *stringsSeen = calloc((uint64_t)1 << (MAX_STRING_SIZE-4u), sizeof(uint8_t));
|
||||
uint32_t len;
|
||||
for(len = 4u; len <= MAX_STRING_SIZE; len++) {
|
||||
if(!hasSubstringOfLength(len, data, dataLen, stringsSeen)) {
|
||||
|
||||
Reference in New Issue
Block a user