summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stefw@collabora.co.uk>2011-05-30 13:12:01 +0200
committerStef Walter <stefw@collabora.co.uk>2011-05-30 13:12:46 +0200
commitb3b68fcb1d3fc4958acc6f6528fb88e7c87b7512 (patch)
tree9e0b82ee3d64cde52d0f6e62c7919a4461d248f3
parent2aa964160a1615077db18b03a6c72c286c27791f (diff)
Add function p11_kit_uri_space_strlen() for figuring out the length
of space terminated strings.
-rw-r--r--doc/p11-kit-sections.txt1
-rw-r--r--p11-kit/uri.c6
-rw-r--r--p11-kit/uri.h3
3 files changed, 7 insertions, 3 deletions
diff --git a/doc/p11-kit-sections.txt b/doc/p11-kit-sections.txt
index baae53f..c82d6e3 100644
--- a/doc/p11-kit-sections.txt
+++ b/doc/p11-kit-sections.txt
@@ -43,6 +43,7 @@ p11_kit_finalize_module
<SECTION>
<FILE>p11-kit-util</FILE>
p11_kit_strerror
+p11_kit_uri_space_strlen
<SUBSECTION Private>
CK_FUNCTION_LIST_PTR
CK_RV
diff --git a/p11-kit/uri.c b/p11-kit/uri.c
index 55b0809..b3cbc6a 100644
--- a/p11-kit/uri.c
+++ b/p11-kit/uri.c
@@ -724,8 +724,8 @@ p11_kit_uri_new (void)
return uri;
}
-static size_t
-space_strlen (const unsigned char *string, size_t max_length)
+size_t
+p11_kit_uri_space_strlen (const unsigned char *string, size_t max_length)
{
size_t i = max_length - 1;
@@ -796,7 +796,7 @@ format_struct_string (char **string, size_t *length, int *is_first,
if (!value[0])
return 1;
- len = space_strlen (value, value_max);
+ len = p11_kit_uri_space_strlen (value, value_max);
return format_encode_string (string, length, is_first, name, value, len);
}
diff --git a/p11-kit/uri.h b/p11-kit/uri.h
index e19166d..c8bc9c7 100644
--- a/p11-kit/uri.h
+++ b/p11-kit/uri.h
@@ -140,6 +140,9 @@ void p11_kit_uri_free (P11KitUri *uri);
const char* p11_kit_uri_message (int code);
+size_t p11_kit_uri_space_strlen (const unsigned char *string,
+ size_t max_length);
+
#ifdef __cplusplus
} /* extern "C" */
#endif