Skip to content

Commit

Permalink
More const
Browse files Browse the repository at this point in the history
  • Loading branch information
terryburton committed Jul 1, 2024
1 parent cc94a04 commit a3625d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/c-lib/ai.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@ const struct aiEntry* gs1_lookupAIentry(const gs1_encoder* const ctx, const char
*
*/
while (s < e) {
size_t m = s + (e - s) / 2;
const size_t m = s + (e - s) / 2;
const struct aiEntry *entry = &ctx->aiTable[m];
size_t entrylen = strlen(entry->ai);
int cmp = strncmp(entry->ai, p, entrylen);
const size_t entrylen = strlen(entry->ai);
const int cmp = strncmp(entry->ai, p, entrylen);
if (cmp == 0) {
if (ailen != 0 && entrylen != ailen)
return NULL; // Prefix match, but incorrect length
Expand Down

0 comments on commit a3625d3

Please sign in to comment.