diff options
Diffstat (limited to 'src/lib/util/strings.c')
-rw-r--r-- | src/lib/util/strings.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/util/strings.c b/src/lib/util/strings.c index f2b88ef47..4f729771c 100644 --- a/src/lib/util/strings.c +++ b/src/lib/util/strings.c | |||
@@ -945,9 +945,8 @@ GNUNET_STRINGS_parse_uri (const char *path, | |||
945 | return GNUNET_NO; | 945 | return GNUNET_NO; |
946 | if (scheme_part) | 946 | if (scheme_part) |
947 | { | 947 | { |
948 | *scheme_part = GNUNET_malloc (post_scheme_part - path + 1); | 948 | *scheme_part = GNUNET_strndup (path, |
949 | GNUNET_memcpy (*scheme_part, path, post_scheme_part - path); | 949 | post_scheme_part - path); |
950 | (*scheme_part)[post_scheme_part - path] = '\0'; | ||
951 | } | 950 | } |
952 | if (path_part) | 951 | if (path_part) |
953 | *path_part = post_scheme_part; | 952 | *path_part = post_scheme_part; |