mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-09-05 20:24:34 +08:00
fix fct when called with a one byte array
This commit is contained in:
parent
c3e29789a9
commit
7414cdf359
2 changed files with 5 additions and 1 deletions
|
@ -1563,6 +1563,10 @@ int byte_strstr(const uint8_t *src, size_t srclen, const uint8_t *pattern, size_
|
|||
continue;
|
||||
}
|
||||
|
||||
if (plen == 1) {
|
||||
return i;
|
||||
}
|
||||
|
||||
// try to match rest of the pattern
|
||||
for (int j = plen - 1; j >= 1; j--) {
|
||||
|
||||
|
|
|
@ -453,7 +453,7 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
// make the table of tables
|
||||
t = (struct table *)calloc(sizeof(struct table) * 65536, sizeof(uint8_t));
|
||||
if (!t) {
|
||||
if (t == NULL) {
|
||||
printf("calloc failed\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue