From: Benjamin Drung Date: Wed, 13 Jun 2018 09:48:39 +0000 (+0200) Subject: mount_main: Fix empty string check X-Git-Tag: archive/raspbian/2.0.4-15+rpi1^2~12 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=72595918ee7f4fa9fb52c2c9a5a061fbba712d30;p=klibc.git 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') ^ ``` Gbp-Pq: Name mount_main-Fix-empty-string-check.patch --- diff --git a/usr/utils/mount_main.c b/usr/utils/mount_main.c index ab3cb71..0d299c4 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"); }