summaryrefslogtreecommitdiffstats
path: root/libblkid/src/encode.c
diff options
context:
space:
mode:
authorOndrej Oprala2015-02-03 16:30:15 +0100
committerKarel Zak2015-02-24 10:22:37 +0100
commit6c4a7811f85fc64cb0b0fb9f3e266592ed9c40dc (patch)
treefa3dd1b62a64c4240171fa80e9c3946e08e91b03 /libblkid/src/encode.c
parentdocs: add terminal-colors requests to TODO (diff)
downloadkernel-qcow2-util-linux-6c4a7811f85fc64cb0b0fb9f3e266592ed9c40dc.tar.gz
kernel-qcow2-util-linux-6c4a7811f85fc64cb0b0fb9f3e266592ed9c40dc.tar.xz
kernel-qcow2-util-linux-6c4a7811f85fc64cb0b0fb9f3e266592ed9c40dc.zip
libblkid: make probing data structures more dynamic
* replace static probing result array with list * use allocated buffers for probing result variables [kzak@redhat.com: - rename some functions - clean up \0 terminator usage in variables - remove never used code to convert UUID to lower-case - remove possible memory leaks on errors] Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid/src/encode.c')
-rw-r--r--libblkid/src/encode.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libblkid/src/encode.c b/libblkid/src/encode.c
index ff57be4cb..466e4540f 100644
--- a/libblkid/src/encode.c
+++ b/libblkid/src/encode.c
@@ -268,6 +268,12 @@ size_t blkid_encode_to_utf8(int enc, unsigned char *dest, size_t len,
return j;
}
+unsigned char *blkid_encode_alloc(size_t count, size_t *reslen)
+{
+ *reslen = (count * 3) + 1;
+ return calloc(1, *reslen);
+}
+
/**
* blkid_encode_string:
* @str: input string to be encoded