Commit e7bb1fe8 by Patrick Steinhardt

examples: avoid passing signed integer to `memchr`

The memchr(3P) function expects a `size_t` as its last parameter, but we
do pass it an object size, which is of signed type `git_off_t`. As we
can be sure that the result will be non-negative, let's just cast the
parameter to a `size_t`.
parent 976eed80
......@@ -91,7 +91,7 @@ int lg2_blame(git_repository *repo, int argc, char *argv[])
i = 0;
break_on_null_hunk = 0;
while (i < rawsize) {
const char *eol = memchr(rawdata + i, '\n', rawsize - i);
const char *eol = memchr(rawdata + i, '\n', (size_t)(rawsize - i));
char oid[10] = {0};
const git_blame_hunk *hunk = git_blame_get_hunk_byline(blame, line);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment