Commit 35562617 authored by Natanael Copa's avatar Natanael Copa

version: avoid end up in endless loop if we compare 2 equal invalid versions

fixes issue with apk version -t asdf asdf
parent 916c396c
......@@ -143,7 +143,7 @@ int apk_version_compare(apk_blob_t a, apk_blob_t b)
int at = TOKEN_DIGIT, bt = TOKEN_DIGIT;
int av = 0, bv = 0;
while (at == bt && at != TOKEN_END && av == bv) {
while (at == bt && at != TOKEN_END && at != TOKEN_INVALID && av == bv) {
av = get_token(&at, &a);
bv = get_token(&bt, &b);
#if 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment