summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/apk_version.h1
-rw-r--r--src/ver.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/src/apk_version.h b/src/apk_version.h
index dcbf20f..4275343 100644
--- a/src/apk_version.h
+++ b/src/apk_version.h
@@ -14,6 +14,7 @@
#include "apk_blob.h"
+#define APK_VERSION_UNKNOWN 0
#define APK_VERSION_EQUAL 1
#define APK_VERSION_LESS 2
#define APK_VERSION_GREATER 4
diff --git a/src/ver.c b/src/ver.c
index 4bfd607..90b6cd6 100644
--- a/src/ver.c
+++ b/src/ver.c
@@ -125,7 +125,8 @@ static void ver_print_package_status(struct ver_ctx *ictx, struct apk_database *
break;
}
}
- r = apk_version_compare_blob(*pkg->version, *latest);
+ r = latest->len ? apk_version_compare_blob(*pkg->version, *latest)
+ : APK_VERSION_UNKNOWN;
opstr = apk_version_op_string(r);
if ((ictx->limchars != NULL) && (strchr(ictx->limchars, *opstr) == NULL))
return;