]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix a typo in the sscanf format string for Amazon Linux
authorOliver Kurth <okurth@vmware.com>
Wed, 7 Mar 2018 23:35:47 +0000 (15:35 -0800)
committerOliver Kurth <okurth@vmware.com>
Wed, 7 Mar 2018 23:35:47 +0000 (15:35 -0800)
open-vm-tools/lib/misc/hostinfoPosix.c

index bf1ef47235c08cb606f1d6fa3a477fb6f50bdb2f..388871d96ad038434ec3d21e30c917437e8ed8d7 100644 (file)
@@ -751,14 +751,11 @@ HostinfoGetOSShortName(char *distro,         // IN: full distro name
    } else if (strstr(distroLower, "sun")) {
       Str_Strcpy(distroShort, STR_OS_SUN_DESK, distroShortSize);
    } else if (strstr(distroLower, "amazon")) {
-      int amazonMinor = 0;
       int amazonMajor = 0;
 
-      if (sscanf(distroLower, "Amazon Linux %d.%d", &amazonMajor,
-                 &amazonMinor) != 2) {
+      if (sscanf(distroLower, "amazon linux %d", &amazonMajor) != 1) {
          /* Oldest known good release */
          amazonMajor = 2;
-         amazonMinor = 0;
       }
 
       Str_Sprintf(distroShort, distroShortSize, "%s%d", STR_OS_AMAZON,