]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
p is a pointer and cannot be negative so check if it is NULL
authorS.Çağlar Onur <caglar@10ur.org>
Fri, 15 Nov 2013 05:33:54 +0000 (00:33 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 18 Nov 2013 15:48:32 +0000 (10:48 -0500)
Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/utils.c

index 3fab9ae7ebadbb87b1a9010593039553ea4f45df..e2d263900979f3320880b67529310328b3c15794 100644 (file)
@@ -483,7 +483,7 @@ int sha1sum_file(char *fnam, unsigned char *digest)
        process_lock();
        f = fopen_cloexec(fnam, "r");
        process_unlock();
-       if (f < 0) {
+       if (!f) {
                SYSERROR("Error opening template");
                return -1;
        }