diff mbox

[1/2] filefrag: fix GCC7.x compiler warning

Message ID 856ed7be-9cb4-eb8d-1ce5-3f07adf600b6@dragonfly.plus.com
State Accepted, archived
Headers show

Commit Message

Marc Thomas June 26, 2017, 3:39 p.m. UTC
../../misc/filefrag.c:591:33: warning: comparison between pointer and
zero character constant [-Wpointer-compare]
  for (cpp = argv + optind; *cpp != '\0'; cpp++) {

Signed-off-by: Marc Thomas <marc@dragonfly.plus.com>
---
 misc/filefrag.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Theodore Ts'o June 28, 2017, 5:28 p.m. UTC | #1
On Mon, Jun 26, 2017 at 04:39:47PM +0100, Marc Thomas wrote:
> ../../misc/filefrag.c:591:33: warning: comparison between pointer and
> zero character constant [-Wpointer-compare]
>   for (cpp = argv + optind; *cpp != '\0'; cpp++) {
> 
> Signed-off-by: Marc Thomas <marc@dragonfly.plus.com>

The patch was corrutped somehow, but I applied the fix.

Thanks,

					- Ted
diff mbox

Patch

diff --git a/misc/filefrag.c b/misc/filefrag.c
index 1a185124..9c57ab93 100644
--- a/misc/filefrag.c
+++ b/misc/filefrag.c
@@ -588,7 +588,7 @@  int main(int argc, char**argv)
 	if (optind == argc)
 		usage(argv[0]);
 -	for (cpp = argv + optind; *cpp != '\0'; cpp++) {
+	for (cpp = argv + optind; *cpp != NULL; cpp++) {
 		int rc2 = frag_report(*cpp);
  		if (rc2 < 0 && rc == 0)
-- 
2.13.0