Skip to contentSkip to conversation

master - libdm: replace assign with increment

PATCH Zdenek Kabelac 1 participant 1 message Nov 9, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fb59847a0fe766ccddf5c3a57e2a0033077d62a2
Commit:        fb59847a0fe766ccddf5c3a57e2a0033077d62a2
Parent:        7ec61cd5b9d4fcafa5313602f0a0696fa4690f6c
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Mon Nov 9 22:48:13 2015 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Nov 9 22:51:48 2015 +0100

libdm: replace assign with increment

Coverity didn't liked assign with && expression, so use trick. It does not complain against this prefix incremenent operation.

---
 libdm/libdm-report.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
libdm/libdm-report.c +2 -3
index 23d0955..b9906d8 100644
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
- * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2015 Red Hat, Inc. All rights reserved.
  *
  * This file is part of the device-mapper userspace tools.
  *
@@ -2219,8 +2219,7 @@ static const char *_tok_value_number(const char *s,
 	int is_float = 0;
 
 	*begin = s;
-	/* coverity[assign_where_compare_meant] */
-	while ((!is_float && (*s == '.') && ((is_float = 1))) || isdigit(*s))
+	while ((!is_float && (*s == '.') && ++is_float) || isdigit(*s))
 		s++;
 	*end = s;