diff options
author | Karel Zak | 2008-10-09 12:00:20 +0200 |
---|---|---|
committer | Karel Zak | 2009-02-11 23:21:46 +0100 |
commit | 2a0f4c4e678513af123f19c91b0c6903bcbb80bd (patch) | |
tree | 4ec1502bee7e447b92fc1265d33a374112a422b6 /libs/blkid/src/probe.c | |
parent | add reiser and reiser4 (diff) | |
download | kernel-qcow2-util-linux-2a0f4c4e678513af123f19c91b0c6903bcbb80bd.tar.gz kernel-qcow2-util-linux-2a0f4c4e678513af123f19c91b0c6903bcbb80bd.tar.xz kernel-qcow2-util-linux-2a0f4c4e678513af123f19c91b0c6903bcbb80bd.zip |
blkid: add HFS and HFS+
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libs/blkid/src/probe.c')
-rw-r--r-- | libs/blkid/src/probe.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/blkid/src/probe.c b/libs/blkid/src/probe.c index 0872a0eae..ee59c2c74 100644 --- a/libs/blkid/src/probe.c +++ b/libs/blkid/src/probe.c @@ -63,7 +63,9 @@ static const struct blkid_idinfo *idinfos[] = &oracleasm_idinfo, &reiser_idinfo, &reiser4_idinfo, - &jbd_idinfo + &jbd_idinfo, + &hfsplus_idinfo, + &hfs_idinfo }; #ifndef ARRAY_SIZE @@ -541,8 +543,7 @@ static size_t encode_to_utf8(int enc, unsigned char *dest, size_t len, size_t i, j; uint16_t c; - j = 0; - for (i = 0; i + 2 <= count; i += 2) { + for (j = i = 0; i + 2 <= count; i += 2) { if (enc == BLKID_ENC_UTF16LE) c = (src[i+1] << 8) | src[i]; else /* BLKID_ENC_UTF16BE */ @@ -584,8 +585,8 @@ int blkid_probe_set_utf8label(blkid_probe pr, unsigned char *label, v = blkid_probe_assign_value(pr, "LABEL"); if (!v) return -1; + v->len = encode_to_utf8(enc, v->data, sizeof(v->data), label, len); - v->len++; /* \0 */ return 0; } |