summaryrefslogtreecommitdiff
path: root/src/version.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/version.c')
-rw-r--r--src/version.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/version.c b/src/version.c
index 2de886a..15757bc 100644
--- a/src/version.c
+++ b/src/version.c
@@ -85,7 +85,7 @@ static int get_token(int *type, apk_blob_t *blob)
case TOKEN_DIGIT_OR_ZERO:
/* Leading zero digits get a special treatment */
if (blob->ptr[i] == '0') {
- while (blob->ptr[i] == '0' && i < blob->len)
+ while (i < blob->len && blob->ptr[i] == '0')
i++;
nt = TOKEN_DIGIT;
v = -i;
@@ -94,7 +94,7 @@ static int get_token(int *type, apk_blob_t *blob)
case TOKEN_DIGIT:
case TOKEN_SUFFIX_NO:
case TOKEN_REVISION_NO:
- while (isdigit(blob->ptr[i]) && i < blob->len) {
+ while (i < blob->len && isdigit(blob->ptr[i])) {
v *= 10;
v += blob->ptr[i++] - '0';
}