Initialize iterator
Iterator wasn't initialized in scrypt parameter scanning.
Bug: 10330227
Change-Id: If41fc25d9f827106fa8329bdb5966b7d786fddcb
diff --git a/cryptfs.c b/cryptfs.c
index 266481d..1e51fd5 100644
--- a/cryptfs.c
+++ b/cryptfs.c
@@ -117,7 +117,8 @@
* The token we're looking for should be three integers separated by
* colons (e.g., "12:8:1"). Scan the property to make sure it matches.
*/
- for (token = strtok_r(paramstr, ":", &saveptr); token != NULL && i < 3;
+ for (i = 0, token = strtok_r(paramstr, ":", &saveptr);
+ token != NULL && i < 3;
i++, token = strtok_r(NULL, ":", &saveptr)) {
char *endptr;
params[i] = strtol(token, &endptr, 10);