Util-Linux package development
 help / color / mirror / Atom feed
* [PATCH] fix warning, gcc 5.0
@ 2015-02-14 18:12 Ruediger Meier
  2015-02-14 18:12 ` [PATCH] fsck: " Ruediger Meier
  0 siblings, 1 reply; 4+ messages in thread
From: Ruediger Meier @ 2015-02-14 18:12 UTC (permalink / raw)
  To: util-linux

From: Ruediger Meier <ruediger.meier@ga-group.nl>

see also pull request on github
https://github.com/karelzak/util-linux/pull/151

Ruediger Meier (1):
  fsck: fix warning, gcc 5.0

 disk-utils/fsck.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
1.8.4.5


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] fsck: fix warning, gcc 5.0
  2015-02-14 18:12 [PATCH] fix warning, gcc 5.0 Ruediger Meier
@ 2015-02-14 18:12 ` Ruediger Meier
  2015-02-15 12:31   ` Bernhard Voelker
  0 siblings, 1 reply; 4+ messages in thread
From: Ruediger Meier @ 2015-02-14 18:12 UTC (permalink / raw)
  To: util-linux

From: Ruediger Meier <ruediger.meier@ga-group.nl>

disk-utils/fsck.c:1474:37: warning: logical not is only applied to
the left hand side of comparison [-Wlogical-not-parentheses]
         !strncmp(argv[i+1], "-", 1) == 0) {
                                     ^

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
---
 disk-utils/fsck.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/disk-utils/fsck.c b/disk-utils/fsck.c
index 78ad43e..8825f0e 100644
--- a/disk-utils/fsck.c
+++ b/disk-utils/fsck.c
@@ -1471,7 +1471,7 @@ static void parse_argv(int argc, char *argv[])
 					else
 						goto next_arg;
 				} else if ((i+1) < argc &&
-					   !strncmp(argv[i+1], "-", 1) == 0) {
+					   strncmp(argv[i+1], "-", 1) != 0) {
 					progress_fd = string_to_int(argv[i]);
 					if (progress_fd < 0)
 						progress_fd = 0;
-- 
1.8.4.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] fsck: fix warning, gcc 5.0
  2015-02-14 18:12 ` [PATCH] fsck: " Ruediger Meier
@ 2015-02-15 12:31   ` Bernhard Voelker
  2015-02-16 10:13     ` Karel Zak
  0 siblings, 1 reply; 4+ messages in thread
From: Bernhard Voelker @ 2015-02-15 12:31 UTC (permalink / raw)
  To: Ruediger Meier, util-linux

On 02/14/2015 07:12 PM, Ruediger Meier wrote:
> -					   !strncmp(argv[i+1], "-", 1) == 0) {
> +					   strncmp(argv[i+1], "-", 1) != 0) {

... or better avoid the strncmp() for 1 character at all?

Have a nice day,
Berny

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fsck: fix warning, gcc 5.0
  2015-02-15 12:31   ` Bernhard Voelker
@ 2015-02-16 10:13     ` Karel Zak
  0 siblings, 0 replies; 4+ messages in thread
From: Karel Zak @ 2015-02-16 10:13 UTC (permalink / raw)
  To: Bernhard Voelker; +Cc: Ruediger Meier, util-linux

On Sun, Feb 15, 2015 at 01:31:29PM +0100, Bernhard Voelker wrote:
> On 02/14/2015 07:12 PM, Ruediger Meier wrote:
> > -					   !strncmp(argv[i+1], "-", 1) == 0) {
> > +					   strncmp(argv[i+1], "-", 1) != 0) {
> 
> ... or better avoid the strncmp() for 1 character at all?

 Yes, fixed.

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-02-16 10:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-14 18:12 [PATCH] fix warning, gcc 5.0 Ruediger Meier
2015-02-14 18:12 ` [PATCH] fsck: " Ruediger Meier
2015-02-15 12:31   ` Bernhard Voelker
2015-02-16 10:13     ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox