diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2015-04-09 16:06:48 +0300 |
---|---|---|
committer | Olivier Goffart <ogoffart@woboq.com> | 2015-04-09 16:06:48 +0300 |
commit | c917251e9ebeeaf798ebe2096b9f86af6d8040c6 (patch) | |
tree | 5111ed36479568f86a4559af00208ec317f56146 /csync | |
parent | c805c5d6e9722728ef484c0c70bf14d8d9673336 (diff) |
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
Diffstat (limited to 'csync')
-rw-r--r-- | csync/src/csync_reconcile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/csync/src/csync_reconcile.c b/csync/src/csync_reconcile.c index 8ceb8577b..861910f5d 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); |