Eliminate 'possibly incorrect assignment in CORD_vsprintf' compiler warning
authorIvan Maidanski <ivmai@mail.ru>
Tue, 29 May 2018 17:45:23 +0000 (20:45 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 29 May 2018 17:45:23 +0000 (20:45 +0300)
* cord/cordprnt.c (CORD_vsprintf): Replace while((c=expr)) with
while((c=expr)!=0).

cord/cordprnt.c

index cfe1de4..2dd5691 100644 (file)
@@ -275,7 +275,7 @@ int CORD_vsprintf(CORD * out, CORD format, va_list args)
                             char * str = va_arg(args, char *);
                             char c;
 
-                            while ((c = *str++)) {
+                            while ((c = *str++) != '\0') {
                                 CORD_ec_append(result, c);
                             }
                             goto done;
@@ -362,7 +362,7 @@ int CORD_vsprintf(CORD * out, CORD format, va_list args)
                     if (buf != result[0].ec_bufptr) {
                         char c;
 
-                        while ((c = *buf++)) {
+                        while ((c = *buf++) != '\0') {
                             CORD_ec_append(result, c);
                         }
                     } else {