Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115093
b: refs/heads/master
c: 97ce0a7
h: refs/heads/master
i:
  115091: a60d243
v: v3
  • Loading branch information
Dan Williams authored and NeilBrown committed Oct 16, 2008
1 parent f286138 commit 965e758
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 08ff39f1c8f2134f7d0f38123ca5952371665cc5
refs/heads/master: 97ce0a7f9caf9d715cee815a016ee21575f71c95
8 changes: 3 additions & 5 deletions trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -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<len; i++) {
if (dot) {
if (isdigit(buf[i])) {
Expand All @@ -2412,8 +2411,7 @@ safe_delay_store(mddev_t *mddev, const char *cbuf, size_t len)
buf[i] = 0;
}
}
msec = simple_strtoul(buf, &e, 10);
if (e == buf || (*e && *e != '\n'))
if (strict_strtoul(buf, 10, &msec) < 0)
return -EINVAL;
msec = (msec * 1000) / scale;
if (msec == 0)
Expand Down

0 comments on commit 965e758

Please sign in to comment.