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:
manuel-domke
2023-02-11 15:52:14 +01:00
parent 5ce538e95a
commit 2e6cfbe69f

2
software/tools/findlongest.c Normal file → Executable file
View 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)) {