diff --git a/drivers/md/md.c b/drivers/md/md.c index 39c9c87a13425abfbedf9b52934d88f5f36facd6..aaa3d465de4ece202bd3a18c1c605248ebd40ad7 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -2394,12 +2394,11 @@ safe_delay_store(mddev_t *mddev, const char *cbuf, size_t len) int i; unsigned long msec; char buf[30]; - char *e; + /* remove a period, and count digits after it */ if (len >= sizeof(buf)) return -EINVAL; - strlcpy(buf, cbuf, len); - buf[len] = 0; + strlcpy(buf, cbuf, sizeof(buf)); for (i=0; i