From f16f6864e5d1e81ec9373ce40f5b0cc6b8937d9c Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 29 Jul 2010 11:16:29 +0000 Subject: [PATCH] Fixed truncating the last char while writing to filename attribute git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1889 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 76bdd6be1..d90af2c7f 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -3610,8 +3610,8 @@ static int vcdrom_change(struct scst_vdisk_dev *virt_dev, p++; filename = p; p = &i_buf[length-1]; - pp = p; - while (isspace(*p) && *p != '\0') { + pp = &i_buf[length]; + while (isspace(*p) && (*p != '\0')) { pp = p; p--; }