summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/bitmap.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/bitmap.c b/lib/bitmap.c
index 5d2540396300..d4b3a6d4b2d7 100644
--- a/lib/bitmap.c
+++ b/lib/bitmap.c
@@ -665,13 +665,8 @@ static int __bitmap_parselist(const char *buf, unsigned int buflen,
int bitmap_parselist(const char *bp, unsigned long *maskp, int nmaskbits)
{
- char *nl = strchr(bp, '\n');
- int len;
-
- if (nl)
- len = nl - bp;
- else
- len = strlen(bp);
+ char *nl = strchrnul(bp, '\n');
+ int len = nl - bp;
return __bitmap_parselist(bp, len, 0, maskp, nmaskbits);
}