From 18053cfdb93b1deaba923a85eb2b51c20c9b7d46 Mon Sep 17 00:00:00 2001 From: Mephistopheles Date: Sun, 7 Feb 2016 14:25:00 +0300 Subject: [PATCH] * Fixed uninit variables * Removed check less 0 with unsigned --- src/dump.c | 2 +- src/utf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dump.c b/src/dump.c index 912f955..29e01dd 100644 --- a/src/dump.c +++ b/src/dump.c @@ -75,7 +75,7 @@ static int dump_indent(size_t flags, int depth, int space, json_dump_callback_t static int dump_string(const char *str, size_t len, json_dump_callback_t dump, void *data, size_t flags) { const char *pos, *end, *lim; - int32_t codepoint; + int32_t codepoint = 0; if(dump("\"", 1, data)) return -1; diff --git a/src/utf.c b/src/utf.c index b56e125..daacb7f 100644 --- a/src/utf.c +++ b/src/utf.c @@ -145,7 +145,7 @@ const char *utf8_iterate(const char *buffer, size_t bufsize, int32_t *codepoint) return buffer; count = utf8_check_first(buffer[0]); - if(count <= 0) + if(count == 0) return NULL; if(count == 1)