[Pkg-owncloud-commits] [owncloud-client] 85/159: Reconcile: Fix clang warning

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri May 1 13:05:26 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit c917251e9ebeeaf798ebe2096b9f86af6d8040c6
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Thu Apr 9 15:06:48 2015 +0200

    Reconcile: Fix clang warning
    
    csync_reconcile.c:159:26: warning: address of array 'tmp->path' will always evaluate to 'true' [-Wpointer-bool-conversion]
                    if( tmp->path ) {
                    ~~  ~~~~~^~~~
    
    csync_file_stat_s::path is an array so it is never null
    What was meant here is to check if the string was not empty
---
 csync/src/csync_reconcile.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/csync/src/csync_reconcile.c b/csync/src/csync_reconcile.c
index 8ceb857..861910f 100644
--- a/csync/src/csync_reconcile.c
+++ b/csync/src/csync_reconcile.c
@@ -156,8 +156,8 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
             }
 
             if( tmp ) {
-                if( tmp->path ) {
-                    len = strlen( tmp->path );
+                len = strlen( tmp->path );
+                if( len > 0 ) {
                     h = c_jhash64((uint8_t *) tmp->path, len, 0);
                     /* First, check that the file is NOT in our tree (another file with the same name was added) */
                     node = c_rbtree_find(ctx->current == REMOTE_REPLICA ? ctx->remote.tree : ctx->local.tree, &h);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list