]> asedeno.scripts.mit.edu Git - git.git/commitdiff
diff.c: work around pointer constness warnings
authorJunio C Hamano <gitster@pobox.com>
Fri, 9 Apr 2010 06:30:49 +0000 (23:30 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 9 Apr 2010 06:30:49 +0000 (23:30 -0700)
The textconv leak fix introduced two invocations of free() to release
memory pointed by "const char *", which get annoying compiler warning.

diff.c

diff --git a/diff.c b/diff.c
index db2cd5d35f9de3e7ce74ae36a64f495c82dc836a..c23093d6c0b0fa120d0f2f3aa7d17ae3a4d560b3 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -551,9 +551,9 @@ static void emit_rewrite_diff(const char *name_a,
        if (lc_b)
                emit_rewrite_lines(&ecbdata, '+', data_two, size_two);
        if (textconv_one)
-               free(data_one);
+               free((char *)data_one);
        if (textconv_two)
-               free(data_two);
+               free((char *)data_two);
 }
 
 struct diff_words_buffer {