utf8: NO_ICONV: silence uninitialized variable warning
commite654eb29ab9da97f6acabc261f88aa1f41f78a8f
authorEric Sunshine <sunshine@sunshineco.com>
Fri, 5 Jun 2015 06:42:16 +0000 (5 02:42 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 5 Jun 2015 22:36:35 +0000 (5 15:36 -0700)
treecad8610ce7b2981a0fb54155ffd638eb4ef3b686
parent282616c72d1d08a77ca4fe1186cb708c38408d87
utf8: NO_ICONV: silence uninitialized variable warning

The last argument of reencode_string_len() is an 'int *' which is
assigned the length of the converted string. When NO_ICONV is defined,
however, reencode_string_len() is stubbed out by the macro:

    #define reencode_string_len(a,b,c,d,e) NULL

which never assigns a value to the final argument. When called like
this:

    int n;
    char *s = reencode_string_len(..., &n);
    if (s)
        do_something(s, n);

some compilers complain that 'n' is used uninitialized within the
conditional.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
utf8.h