]> asedeno.scripts.mit.edu Git - git.git/blobdiff - fast-import.c
Use xmemdupz() in many places.
[git.git] / fast-import.c
index e2a4834706659c050cdfd0d53ad3340c9522fa47..f9906586ee252519e65f6d9c4e6a2cff417262bc 100644 (file)
@@ -1864,9 +1864,7 @@ static void file_change_cr(struct branch *b, int rename)
                endp = strchr(s, ' ');
                if (!endp)
                        die("Missing space after source: %s", command_buf.buf);
-               s_uq = xmalloc(endp - s + 1);
-               memcpy(s_uq, s, endp - s);
-               s_uq[endp - s] = 0;
+               s_uq = xmemdupz(s, endp - s);
        }
        s = s_uq;