Merge pull request #3175 from BOINC/dpa_android_vers

scheduler: parse Android version strings of the form "(Android 9)"
This commit is contained in:
lfield 2019-06-04 13:46:12 +02:00 committed by GitHub
commit 1f2d5b14ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -60,7 +60,7 @@ static double os_version_num(HOST h) {
return 0;
}
// parse "Android 4.3.1" or "Android 4.3"
// parse version# from "(Android 4.3.1)" or "(Android 4.3)" or "(Android 4)"
//
static int android_version_num(HOST h) {
int maj, min, rel;
@ -75,6 +75,10 @@ static int android_version_num(HOST h) {
if (n == 2) {
return maj*10000 + min*100;
}
n = sscanf(p, "%d", &maj);
if (n == 1) {
return maj*10000;
}
return 0;
}