aboutsummaryrefslogtreecommitdiff
path: root/sshfs.c
diff options
context:
space:
mode:
authorkalvdans <github@kalvdans.no-ip.org>2019-11-03 10:28:37 +0100
committerNikolaus Rath <Nikolaus@rath.org>2019-11-03 09:28:36 +0000
commit011986306b8ed6d940bbe5b8faebd55ff5c63f99 (patch)
tree957b64e1441e844e17f81d4476031b3121556931 /sshfs.c
parente1a9050c61bba5b51e21dbf8e80020c5c1d7c9ba (diff)
downloadsshfs-011986306b8ed6d940bbe5b8faebd55ff5c63f99.tar
sshfs-011986306b8ed6d940bbe5b8faebd55ff5c63f99.tar.gz
sshfs-011986306b8ed6d940bbe5b8faebd55ff5c63f99.tar.bz2
sshfs-011986306b8ed6d940bbe5b8faebd55ff5c63f99.zip
Remedy gcc 7.4.0 warnings (#187)
* 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]
Diffstat (limited to 'sshfs.c')
-rw-r--r--sshfs.c4
1 files changed, 2 insertions, 2 deletions
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);
}