From 3da5c316b7b992fcc33328043151cf8cb25bf640 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 8 Sep 2009 07:31:04 +0000 Subject: [PATCH] helping llvm static analyzer a bit --- src/fs/fs_directory.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/fs/fs_directory.c b/src/fs/fs_directory.c index 0fbd236ca..89a016efd 100644 --- a/src/fs/fs_directory.c +++ b/src/fs/fs_directory.c @@ -515,7 +515,7 @@ GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, sizes = NULL; perm = NULL; bes = NULL; - if (bld->count > 0) + if (0 < bld->count) { sizes = GNUNET_malloc (bld->count * sizeof (size_t)); perm = GNUNET_malloc (bld->count * sizeof (unsigned int)); @@ -532,13 +532,13 @@ GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, bld->count, sizes, perm); - } - /* compute final size with alignment */ - for (i = 0; i < bld->count; i++) - { - psize = size; - size += sizes[perm[i]]; - size = do_align (psize, size); + /* compute final size with alignment */ + for (i = 0; i < bld->count; i++) + { + psize = size; + size += sizes[perm[i]]; + size = do_align (psize, size); + } } *rsize = size; data = GNUNET_malloc (size); -- 2.25.1