kernel: make for loop compatible (#1517)

This commit is contained in:
Jprimero15
2024-03-24 15:04:57 +08:00
committed by GitHub
parent dc5f911e43
commit 96242df228

View File

@@ -34,7 +34,8 @@ static int get_pkg_from_apk_path(char *pkg, const char *path)
const char *last_slash = NULL;
const char *second_last_slash = NULL;
for (int i = len - 1; i >= 0; i--) {
int i;
for (i = len - 1; i >= 0; i--) {
if (path[i] == '/') {
if (!last_slash) {
last_slash = &path[i];