summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cam/cam.c')
-rw-r--r--sys/cam/cam.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/cam/cam.c b/sys/cam/cam.c
index eff83a1..85b02fb 100644
--- a/sys/cam/cam.c
+++ b/sys/cam/cam.c
@@ -165,8 +165,12 @@ cam_strmatch(const u_int8_t *str, const u_int8_t *pattern, int str_len)
str++;
str_len--;
}
- while (str_len > 0 && *str++ == ' ')
+ while (str_len > 0 && *str == ' ') {
+ str++;
str_len--;
+ }
+ if (str_len > 0 && *str == 0)
+ str_len = 0;
return (str_len);
}
OpenPOWER on IntegriCloud