helpers: fix detection of partition in non-subdirboot layout

Origin commit data
------------------
Commit: 78fc37b0b1
Author: vanhofen <vanhofen@gmx.de>
Date: 2023-01-13 (Fri, 13 Jan 2023)

Origin message was:
------------------
- helpers: fix detection of partition in non-subdirboot layout
This commit is contained in:
vanhofen
2023-01-13 21:56:58 +01:00
parent a17efd762c
commit c1c6b7f6ca

View File

@@ -2203,6 +2203,7 @@ int getActivePartition()
if (strncmp("linuxrootfs", p, 11) == 0)
{
c = atoi(p + 11);
dprintf(DEBUG_NORMAL, "Current subdirboot partition: %d\n", c);
break;
}
p = strtok(NULL, " =");
@@ -2218,7 +2219,10 @@ int getActivePartition()
{
if (fseek(f, -2, SEEK_END) == 0)
{
c = (int)fgetc(f);
char c2[2] = {0};
c2[0] = fgetc(f);
c = atoi(c2);
dprintf(DEBUG_NORMAL, "Current partition: %d\n", c);
}
fclose(f);
}