diff options
Diffstat (limited to 'src/filter.c')
-rw-r--r-- | src/filter.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/filter.c b/src/filter.c index d2d113409..3389bed69 100644 --- a/src/filter.c +++ b/src/filter.c @@ -19,13 +19,13 @@ void git_text_gather_stats(git_text_stats *stats, const git_buf *text) memset(stats, 0, sizeof(*stats)); - for (i = 0; i < text->size; i++) { + for (i = 0; i < git_buf_len(text); i++) { unsigned char c = text->ptr[i]; if (c == '\r') { stats->cr++; - if (i + 1 < text->size && text->ptr[i + 1] == '\n') + if (i + 1 < git_buf_len(text) && text->ptr[i + 1] == '\n') stats->crlf++; } @@ -59,7 +59,7 @@ void git_text_gather_stats(git_text_stats *stats, const git_buf *text) } /* If file ends with EOF then don't count this EOF as non-printable. */ - if (text->size >= 1 && text->ptr[text->size - 1] == '\032') + if (git_buf_len(text) >= 1 && text->ptr[text->size - 1] == '\032') stats->nonprintable--; } @@ -127,14 +127,14 @@ int git_filters_apply(git_buf *dest, git_buf *source, git_vector *filters) src = 0; - if (source->size == 0) { + if (git_buf_len(source) == 0) { git_buf_clear(dest); return GIT_SUCCESS; } /* Pre-grow the destination buffer to more or less the size * we expect it to have */ - if (git_buf_grow(dest, source->size) < 0) + if (git_buf_grow(dest, git_buf_len(source)) < 0) return GIT_ENOMEM; for (i = 0; i < filters->length; ++i) { |