diff options
author | Benjamin Drung <benjamin.drung@profitbricks.com> | 2018-06-13 11:48:39 +0200 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2019-01-02 03:08:04 +0000 |
commit | 56bfd58fdce4fc32a2be2981655252840c9c02cb (patch) | |
tree | dff8cef66a7067190f1e75e45f520b557b51e676 | |
parent | ee59de58cd3ebe9e98d19aeaadb39915b0b235fc (diff) | |
download | klibc-56bfd58fdce4fc32a2be2981655252840c9c02cb.tar.gz |
[klibc] mount_main: Fix empty string check
gcc 7.3.0 complains:
```
usr/utils/mount_main.c: In function ‘print_mount’:
usr/utils/mount_main.c:46:46: warning: comparison between pointer and zero character constant [-Wpointer-compare]
if (mnt->mnt_type != NULL && mnt->mnt_type != '\0')
^~
usr/utils/mount_main.c:46:32: note: did you mean to dereference the pointer?
if (mnt->mnt_type != NULL && mnt->mnt_type != '\0')
^
usr/utils/mount_main.c:48:46: warning: comparison between pointer and zero character constant [-Wpointer-compare]
if (mnt->mnt_opts != NULL && mnt->mnt_opts != '\0')
^~
usr/utils/mount_main.c:48:32: note: did you mean to dereference the pointer?
if (mnt->mnt_opts != NULL && mnt->mnt_opts != '\0')
^
```
Link: https://www.zytor.com/pipermail/klibc/2018-June/003994.html
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | usr/utils/mount_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr/utils/mount_main.c b/usr/utils/mount_main.c index ab3cb718f0039..0d299c43f436a 100644 --- a/usr/utils/mount_main.c +++ b/usr/utils/mount_main.c @@ -43,9 +43,9 @@ static __noreturn print_mount(char *type) if (type && mnt->mnt_type && strcmp(type, mnt->mnt_type)) continue; printf("%s on %s", mnt->mnt_fsname, mnt->mnt_dir); - if (mnt->mnt_type != NULL && mnt->mnt_type != '\0') + if (mnt->mnt_type != NULL && *mnt->mnt_type != '\0') printf(" type %s", mnt->mnt_type); - if (mnt->mnt_opts != NULL && mnt->mnt_opts != '\0') + if (mnt->mnt_opts != NULL && *mnt->mnt_opts != '\0') printf(" (%s)", mnt->mnt_opts); printf("\n"); } |