src/string.c

changeset 317
ebae0e434898
parent 316
be0f6bd10b52
child 318
348fd9cb7b14
--- a/src/string.c	Mon May 14 19:24:34 2018 +0200
+++ b/src/string.c	Wed May 16 13:13:33 2018 +0200
@@ -73,8 +73,8 @@
 
     for (size_t i = 0 ; i < n ; i++) {
         scstr_t str = va_arg(ap, scstr_t);
-        if(((size_t)-1) - str.length < size) {
-            size = 0;
+        if(SIZE_MAX - str.length < size) {
+            size = SIZE_MAX;
             break;
         }
         size += str.length;

mercurial