Properly initialise variable to fix detection of non-Arch kernel versions master
authorJames Bunton <jamesbunton@delx.net.au>
Mon, 13 Mar 2017 21:30:36 +0000 (08:30 +1100)
committerJames Bunton <jamesbunton@delx.net.au>
Mon, 13 Mar 2017 21:30:36 +0000 (08:30 +1100)
refind/mystrings.c

index 539aba2..eeb6560 100644 (file)
@@ -241,12 +241,14 @@ BOOLEAN LimitStringLength(CHAR16 *TheString, UINTN Limit) {
 // As a special case for Arch Linux the strings "linux" and "linux-lts"
 // are considered to be digits.
 CHAR16 *FindNumbers(IN CHAR16 *InString) {
-    UINTN i, StartOfElement = 0, EndOfElement = 0, CopyLength;
+    UINTN i, StartOfElement, EndOfElement = 0, CopyLength;
     CHAR16 *Found = NULL;
 
     if (InString == NULL)
         return NULL;
 
+    StartOfElement = StrLen(InString);
+
     // Find "linux-lts" or "linux"
     Found = MyStrStr(InString, L"linux-lts");
     if (Found != NULL) {