diff options
author | kalvdans <github@kalvdans.no-ip.org> | 2019-11-03 10:28:37 +0100 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2019-11-03 09:28:36 +0000 |
commit | 011986306b8ed6d940bbe5b8faebd55ff5c63f99 (patch) | |
tree | 957b64e1441e844e17f81d4476031b3121556931 /sshfs.c | |
parent | e1a9050c61bba5b51e21dbf8e80020c5c1d7c9ba (diff) | |
download | sshfs-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); } |