Changeset: 40497f3bfbc9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/40497f3bfbc9
Modified Files:
        common/utils/mstring.c
Branch: default
Log Message:

Work around clang.


diffs (24 lines):

diff --git a/common/utils/mstring.c b/common/utils/mstring.c
--- a/common/utils/mstring.c
+++ b/common/utils/mstring.c
@@ -50,14 +50,15 @@ strtconcat(char *restrict dst, size_t n,
                return -1;
        }
        va_start(ap, src);
-       while (src && dst) {
+       while (src) {
                dst = stpecpy(dst, end, src);
+               if (dst == NULL) {
+                       va_end(ap);
+                       errno = E2BIG;
+                       return -1;
+               }
                src = va_arg(ap, const char *);
        }
        va_end(ap);
-       if (dst == NULL) {
-               errno = E2BIG;
-               return -1;
-       }
        return dst - (end - n);
 }
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to