aboutsummaryrefslogtreecommitdiffstats
path: root/src/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/node.c')
-rw-r--r--src/node.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/node.c b/src/node.c
index 4728c39e..522a939a 100644
--- a/src/node.c
+++ b/src/node.c
@@ -246,12 +246,12 @@ serd_uri_string_length(const SerdURIView* uri)
}
static size_t
-string_sink(const void* buf, size_t len, void* stream)
+string_sink(const void* buf, size_t size, size_t nmemb, void* stream)
{
char** ptr = (char**)stream;
- memcpy(*ptr, buf, len);
- *ptr += len;
- return len;
+ memcpy(*ptr, buf, size * nmemb);
+ *ptr += size * nmemb;
+ return nmemb;
}
SerdNode*
@@ -369,16 +369,16 @@ serd_new_file_uri(const SerdStringView path, const SerdStringView hostname)
SerdBuffer buffer = {uri, uri_len};
for (size_t i = 0; i < path.len; ++i) {
if (is_windows && path.buf[i] == '\\') {
- serd_buffer_sink("/", 1, &buffer);
+ serd_buffer_sink("/", 1, 1, &buffer);
} else if (path.buf[i] == '%') {
- serd_buffer_sink("%%", 2, &buffer);
+ serd_buffer_sink("%%", 1, 2, &buffer);
} else if (is_uri_path_char(path.buf[i])) {
- serd_buffer_sink(path.buf + i, 1, &buffer);
+ serd_buffer_sink(path.buf + i, 1, 1, &buffer);
} else {
char escape_str[10] = {'%', 0, 0, 0, 0, 0, 0, 0, 0, 0};
snprintf(
escape_str + 1, sizeof(escape_str) - 1, "%X", (unsigned)path.buf[i]);
- serd_buffer_sink(escape_str, 3, &buffer);
+ serd_buffer_sink(escape_str, 1, 3, &buffer);
}
}
serd_buffer_sink_finish(&buffer);