diff options
author | David Robillard <d@drobilla.net> | 2020-06-21 17:38:13 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-06-21 18:06:27 +0200 |
commit | dfe59abeecba302a04a2d38a78a40fe356ec81a7 (patch) | |
tree | 72a907aafc0200890a9db2ac3d97e0e15f74478a /src/uri.c | |
parent | f3e2c83e894ebc5ca42e7260215ef5d31e95ded6 (diff) | |
download | serd-dfe59abeecba302a04a2d38a78a40fe356ec81a7.tar.gz serd-dfe59abeecba302a04a2d38a78a40fe356ec81a7.tar.bz2 serd-dfe59abeecba302a04a2d38a78a40fe356ec81a7.zip |
Cleanup: Fix uninitialised variables
Diffstat (limited to 'src/uri.c')
-rw-r--r-- | src/uri.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -102,7 +102,7 @@ serd_uri_string_has_scheme(const uint8_t* utf8) return false; // Invalid scheme initial character, URI is relative } - for (uint8_t c; (c = *++utf8) != '\0';) { + for (uint8_t c = 0; (c = *++utf8) != '\0';) { if (!is_uri_scheme_char(c)) { return false; } else if (c == ':') { @@ -153,7 +153,7 @@ maybe_authority: if (*ptr == '/' && *(ptr + 1) == '/') { ptr += 2; out->authority.buf = ptr; - for (uint8_t c; (c = *ptr) != '\0'; ++ptr) { + for (uint8_t c = 0; (c = *ptr) != '\0'; ++ptr) { switch (c) { case '/': goto path; case '?': goto query; @@ -176,7 +176,7 @@ path: } out->path.buf = ptr; out->path.len = 0; - for (uint8_t c; (c = *ptr) != '\0'; ++ptr) { + for (uint8_t c = 0; (c = *ptr) != '\0'; ++ptr) { switch (c) { case '?': goto query; case '#': goto fragment; @@ -192,7 +192,7 @@ path: query: if (*ptr == '?') { out->query.buf = ++ptr; - for (uint8_t c; (c = *ptr) != '\0'; ++ptr) { + for (uint8_t c = 0; (c = *ptr) != '\0'; ++ptr) { if (c == '#') { goto fragment; } @@ -287,7 +287,7 @@ remove_dot_segments(const uint8_t* path, size_t len, size_t* up) static void merge(SerdChunk* base, SerdChunk* path) { - size_t up; + size_t up = 0; const uint8_t* begin = remove_dot_segments(path->buf, path->len, &up); const uint8_t* end = path->buf + path->len; |