From cb599510d671f3d7692ec91112d0f6c3afce8e1c Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Mon, 20 Dec 2010 18:25:07 +0000 Subject: [PATCH] Two local variables in scst_main.c can be eliminated by using appropriate format specifiers. Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3150 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_main.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index 102bedd2d..888c42d4d 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -1584,15 +1584,12 @@ int scst_add_threads(struct scst_cmd_threads *cmd_threads, } if (dev != NULL) { - char nm[14]; /* to limit the name's len */ - strlcpy(nm, dev->virt_name, ARRAY_SIZE(nm)); thr->cmd_thread = kthread_create(scst_cmd_thread, - cmd_threads, "%s%d", nm, n++); + cmd_threads, "%.13s%d", dev->virt_name, n++); } else if (tgt_dev != NULL) { - char nm[11]; /* to limit the name's len */ - strlcpy(nm, tgt_dev->dev->virt_name, ARRAY_SIZE(nm)); thr->cmd_thread = kthread_create(scst_cmd_thread, - cmd_threads, "%s%d_%d", nm, tgt_dev_num, n++); + cmd_threads, "%.10s%d_%d", + tgt_dev->dev->virt_name, tgt_dev_num, n++); } else thr->cmd_thread = kthread_create(scst_cmd_thread, cmd_threads, "scstd%d", n++);