run: Improve error diagnostics for chdir(2) failure.
[dss.git] / str.c
diff --git a/str.c b/str.c
index 557eaa38ca6352dab2c435ae619ef0fc60700047..cca898d6aa0e4fdcf05eaea528b7d223ef054ccf 100644 (file)
--- a/str.c
+++ b/str.c
@@ -147,16 +147,12 @@ __must_check __printf_1_2 __malloc char *make_message(const char *fmt, ...)
                n = vsnprintf(msg, size, fmt, ap);
                va_end(ap);
                /* If that worked, return the string. */
-               if (n > -1 && n < size)
-                       break;
+               if (n < size)
+                       return msg;
                /* Else try again with more space. */
-               if (n > -1) /* glibc 2.1 */
-                       size = n + 1; /* precisely what is needed */
-               else /* glibc 2.0 */
-                       size *= 2; /* twice the old size */
+               size = n + 1; /* precisely what is needed */
                msg = dss_realloc(msg, size);
        }
-       return msg;
 }
 
 /**