LP954059: Silence uninitialized var warning
authorDan Scott <dan@coffeecode.net>
Sat, 5 May 2012 05:32:25 +0000 (01:32 -0400)
committerDan Scott <dan@coffeecode.net>
Tue, 22 May 2012 05:54:35 +0000 (01:54 -0400)
Compiling osrf_utf8.c generates the following warning:

osrf_utf8.c:510:29: warning: utf8_char may be used uninitialized in this
function [-Wuninitialized]

So... initialize utf8_char when we declare it, and make the compiler
happy.

Signed-off-by: Dan Scott <dan@coffeecode.net>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
src/libopensrf/osrf_utf8.c

index fe468d7..e83be28 100644 (file)
@@ -346,7 +346,7 @@ typedef enum {
 */
 int buffer_append_utf8( growing_buffer* buf, const char* string ) {
        utf8_state state = S_BEGIN;
-       unsigned long utf8_char;
+       unsigned long utf8_char = 0;
        const unsigned char* s = (unsigned char *) string;
        int i = 0;
        int rc = 0;