From 22632603a232d5119027d1757615e786b3e15de5 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 23 Jan 2009 22:55:37 +0100 Subject: [PATCH] blkid: fix ..._strncpy_uuid Signed-off-by: Karel Zak --- libs/blkid/src/probe.c | 2 +- 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 31f3df19..c9f88b05 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 ea770de4..08329501 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 -- 2.39.5