[lxc-devel] [PATCH] coverity: ftell returns a signed value

Dwight Engen dwight.engen at oracle.com
Fri May 3 17:41:40 UTC 2013


The check for flen < 0 could never have been true since flen was declared
to be size_t (unsigned). Declare flen to be long since that is what ftell
returns.

Signed-off-by: Dwight Engen <dwight.engen at oracle.com>
---
 src/lxc/lxccontainer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
index 73c347d..04a9208 100644
--- a/src/lxc/lxccontainer.c
+++ b/src/lxc/lxccontainer.c
@@ -1133,7 +1133,7 @@ static int update_name_and_paths(const char *path, struct lxc_container *oldc,
 		const char *newname, const char *newpath)
 {
 	FILE *f;
-	size_t flen;
+	long flen;
 	char *contents;
 	const char *p0, *p1, *p2, *end;
 	const char *oldpath = oldc->get_config_path(oldc);
-- 
1.8.1.4





More information about the lxc-devel mailing list