summaryrefslogtreecommitdiff
path: root/src/libudev
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2015-04-05 08:30:49 +0200
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2015-04-05 08:46:01 +0200
commit4835f5639a0ec0b8df0b57abdbc2fb07dbe1507c (patch)
treef886948318b1e1afd901c78d93695a8f6ab5bb5f /src/libudev
parentafbbf1369b30e83f7b293d649bda6401e19115e1 (diff)
libudev-util: check length before accesing the array
Diffstat (limited to 'src/libudev')
-rw-r--r--src/libudev/libudev-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c
index 0f8f634ca3..f4656277c6 100644
--- a/src/libudev/libudev-util.c
+++ b/src/libudev/libudev-util.c
@@ -216,7 +216,7 @@ int util_replace_whitespace(const char *str, char *to, size_t len)
/* strip leading whitespace */
i = 0;
- while (isspace(str[i]) && (i < len))
+ while ((i < len) && isspace(str[i]))
i++;
j = 0;