[Libguestfs] [hivex PATCH 5/5] Remove no longer used internal function utf16_string_len_in_bytes.
Richard W.M. Jones
rjones at redhat.com
Wed Apr 13 13:18:57 UTC 2011
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
-------------- next part --------------
>From 54ca9b34eebda11c017b854e54f8891e72f9d131 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones at redhat.com>
Date: Wed, 13 Apr 2011 14:04:16 +0100
Subject: [PATCH 5/5] Remove no longer used internal function utf16_string_len_in_bytes.
---
lib/hivex.c | 18 ++----------------
1 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/lib/hivex.c b/lib/hivex.c
index d2ab23d..573c446 100644
--- a/lib/hivex.c
+++ b/lib/hivex.c
@@ -62,7 +62,6 @@
#define HIVEX_MAX_ALLOCATION 1000000
static char *windows_utf16_to_utf8 (/* const */ char *input, size_t len);
-static size_t utf16_string_len_in_bytes (const char *str);
static size_t utf16_string_len_in_bytes_max (const char *str, size_t len);
struct hive_h {
@@ -1363,23 +1362,10 @@ free_strings (char **argv)
}
/* Get the length of a UTF-16 format string. Handle the string as
- * pairs of bytes, looking for the first \0\0 pair.
+ * pairs of bytes, looking for the first \0\0 pair. Only read up to
+ * 'len' maximum bytes.
*/
static size_t
-utf16_string_len_in_bytes (const char *str)
-{
- size_t ret = 0;
-
- while (str[0] || str[1]) {
- str += 2;
- ret += 2;
- }
-
- return ret;
-}
-
-/* As for utf16_string_len_in_bytes but only read up to a maximum length. */
-static size_t
utf16_string_len_in_bytes_max (const char *str, size_t len)
{
size_t ret = 0;
--
1.7.4.1
More information about the Libguestfs
mailing list