-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0029-fix-mixed-use-of-signed-and-unsigned-type.patch
51 lines (43 loc) · 1.32 KB
/
0029-fix-mixed-use-of-signed-and-unsigned-type.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From 573aae0ba3b76067e76206b78c8243b34e3f40e3 Mon Sep 17 00:00:00 2001
From: "Neil.wrz" <[email protected]>
Date: Tue, 18 Apr 2023 00:05:27 -0700
Subject: [PATCH] fix mixed use of signed and unsigned type
Signed-off-by: Neil.wrz <[email protected]>
---
src/lxc/path.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/lxc/path.c b/src/lxc/path.c
index 46256cb..c0529b7 100644
--- a/src/lxc/path.c
+++ b/src/lxc/path.c
@@ -101,7 +101,7 @@ bool filepath_split(const char *path, char **dir, char **base)
ERROR("Invalid path");
return false;
}
- i = len - 1;
+ i = (ssize_t)(len - 1);
while (i >= 0 && path[i] != '/')
i--;
@@ -326,7 +326,7 @@ static int do_get_symlinks(const char **fullpath, const char *prefix, size_t pre
}
len = strlen(*end);
- if (len >= PATH_MAX - n) {
+ if (len >= (size_t)(PATH_MAX - n)) {
ERROR("Path is too long");
goto out;
}
@@ -619,7 +619,7 @@ char *path_relative(const char *basepath, const char *targpath)
if (b0 != bl) {
// Base elements left. Must go up before going down.
- int seps = 0, i;
+ size_t seps = 0, i;
size_t ncopyed = 0, seps_size;
char *buf = NULL;
@@ -652,4 +652,4 @@ char *path_relative(const char *basepath, const char *targpath)
}
return safe_strdup(targ + t0);
-}
\ No newline at end of file
+}
--
2.25.1