Merge branch 'po/error-message-style' into maint
[gitweb.git] / http-backend.c
index d2c0a625cef558df252af6927cd3a86424674862..f6b7a5bae11bddbfc7743efa52b4440449692cb6 100644 (file)
@@ -607,9 +607,7 @@ int main(int argc, char **argv)
 
                        cmd = c;
                        n = out[0].rm_eo - out[0].rm_so;
-                       cmd_arg = xmalloc(n);
-                       memcpy(cmd_arg, dir + out[0].rm_so + 1, n-1);
-                       cmd_arg[n-1] = '\0';
+                       cmd_arg = xmemdupz(dir + out[0].rm_so + 1, n - 1);
                        dir[out[0].rm_so] = 0;
                        break;
                }