diff options
author | Karel Zak | 2009-01-23 22:55:37 +0100 |
---|---|---|
committer | Karel Zak | 2009-02-11 23:35:24 +0100 |
commit | 22632603a232d5119027d1757615e786b3e15de5 (patch) | |
tree | 7da5f5bcdd39f324488c7fab8214fc794cc4fb56 | |
parent | blkid: add ddf raid regression test (diff) | |
download | kernel-qcow2-util-linux-22632603a232d5119027d1757615e786b3e15de5.tar.gz kernel-qcow2-util-linux-22632603a232d5119027d1757615e786b3e15de5.tar.xz kernel-qcow2-util-linux-22632603a232d5119027d1757615e786b3e15de5.zip |
blkid: fix ..._strncpy_uuid
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r-- | libs/blkid/src/probe.c | 2 | ||||
-rw-r--r-- | tests/expected/blkid/low-probe-ddf-raid | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libs/blkid/src/probe.c b/libs/blkid/src/probe.c index 31f3df19e..c9f88b058 100644 --- a/libs/blkid/src/probe.c +++ b/libs/blkid/src/probe.c @@ -763,7 +763,7 @@ int blkid_probe_strncpy_uuid(blkid_probe pr, unsigned char *str, size_t len) v = blkid_probe_assign_value(pr, "UUID"); if (v) { memcpy((char *) v->data, str, len); - v->data[len - 1] = '\0'; + *(v->data + len) = '\0'; v->len = len; return 0; } diff --git a/tests/expected/blkid/low-probe-ddf-raid b/tests/expected/blkid/low-probe-ddf-raid index ea770de42..083295013 100644 --- a/tests/expected/blkid/low-probe-ddf-raid +++ b/tests/expected/blkid/low-probe-ddf-raid @@ -1,5 +1,5 @@ ID_FS_TYPE=ddf_raid_member ID_FS_USAGE=raid -ID_FS_UUID=8Z_I__B_8Z_I_e_I_q_I___ -ID_FS_UUID_ENC=8Z\xb0I\x95\x10B\x028Z\xb0I\xc8e\xb0I\xb8q\xb0I\xff\xff\xff +ID_FS_UUID=8Z_I__B_8Z_I_e_I_q_I____ +ID_FS_UUID_ENC=8Z\xb0I\x95\x10B\x028Z\xb0I\xc8e\xb0I\xb8q\xb0I\xff\xff\xff\xff ID_FS_VERSION=02.00.00 |