From: Karel Zak Date: Fri, 23 Jan 2009 21:55:37 +0000 (+0100) Subject: blkid: fix ..._strncpy_uuid X-Git-Tag: v2.15-rc1~146 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22632603a232d5119027d1757615e786b3e15de5;p=thirdparty%2Futil-linux.git blkid: fix ..._strncpy_uuid Signed-off-by: Karel Zak --- diff --git a/libs/blkid/src/probe.c b/libs/blkid/src/probe.c index 31f3df19ee..c9f88b058f 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 ea770de42d..0832950135 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