summaryrefslogtreecommitdiff
path: root/futility/updater.c
diff options
context:
space:
mode:
Diffstat (limited to 'futility/updater.c')
-rw-r--r--futility/updater.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/futility/updater.c b/futility/updater.c
index 07d2d668..b17fe936 100644
--- a/futility/updater.c
+++ b/futility/updater.c
@@ -236,9 +236,11 @@ static int host_get_platform_version(void)
if (strncmp(result, STR_REV, strlen(STR_REV)) == 0)
rev = strtol(result + strlen(STR_REV), NULL, 0);
- /* we should never have that large versions,
+ /* we should never have negative or extremely large versions,
* but clamp just to be sure
*/
+ if (rev < 0)
+ rev = 0;
if (rev > INT_MAX)
rev = INT_MAX;