Fixes for compilation
[exim.git] / src / src / transport.c
index 89252ec7a67566083cf60b5c67906a9bf18d6591..3d86919decbf4f8478a824d4e3b56454c06af5a4 100644 (file)
@@ -959,11 +959,10 @@ if (!(tctx->options & topt_no_headers))
 
   if (tctx->options & topt_add_return_path)
     {
-    uschar buffer[EXIM_EMAILADDR_MAX + 20];
-    int n = string_format(CS buffer, sizeof(buffer),
-                          "Return-path: <%.*s>\n",
-                          EXIM_EMAILADDR_MAX, return_path);
-    if (!write_chunk(tctx, buffer, n)) goto bad;
+    int n;
+    uschar * s = string_sprintf("Return-path: <%.*s>\n%n",
+                          EXIM_EMAILADDR_MAX, return_path, &n);
+    if (!write_chunk(tctx, s, n)) goto bad;
     }
 
   /* Add envelope-to: if requested */