]> code.delx.au - refind/commitdiff
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 539aba20bd0fac540949f319ff41725379192524..eeb656012acbf1343b3cf2680fad780c5d1b6bf5 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) {
 // 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;
 
     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) {
     // Find "linux-lts" or "linux"
     Found = MyStrStr(InString, L"linux-lts");
     if (Found != NULL) {