From 011986306b8ed6d940bbe5b8faebd55ff5c63f99 Mon Sep 17 00:00:00 2001 From: kalvdans Date: Sun, 3 Nov 2019 10:28:37 +0100 Subject: Remedy gcc 7.4.0 warnings (#187) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use logical not for booleans Fixes a gcc 7.4.0 complaint: sshfs.c:1743:28: warning: ‘~’ on a boolean expression [-Wbool-operation] sshfs.c:1743:28: note: did you mean to use logical not? * strdup argument to keep it alive after function return Fixes gcc 7.4.0 complaint: sshfs.c: In function ‘sshfs_opt_proc’: sshfs.c:3488:50: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] --- sshfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sshfs.c') diff --git a/sshfs.c b/sshfs.c index a3dba80..d4d624d 100644 --- a/sshfs.c +++ b/sshfs.c @@ -1745,7 +1745,7 @@ static void *sshfs_init(struct fuse_conn_info *conn, sshfs.sync_read = 1; // These workarounds require the "path" argument. - cfg->nullpath_ok = ~(sshfs.truncate_workaround || sshfs.fstat_workaround); + cfg->nullpath_ok = !(sshfs.truncate_workaround || sshfs.fstat_workaround); // Lookup of . and .. is supported conn->capable |= FUSE_CAP_EXPORT_SUPPORT; @@ -3494,7 +3494,7 @@ static int sshfs_opt_proc(void *data, const char *arg, int key, * mountpoint to later be completely * unprivileged with libfuse >= 3.3.0. */ - sshfs.mountpoint = arg; + sshfs.mountpoint = strdup(arg); } else { sshfs.mountpoint = realpath(arg, NULL); } -- cgit v1.2.3