summaryrefslogtreecommitdiff
path: root/convert.c
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2011-08-29 22:06:04 +0200
committerJunio C Hamano <gitster@pobox.com>2011-08-29 15:23:22 -0700
commit7732118438764cfe49b8e0ad2c63e6dc97be45ed (patch)
tree16c111d1e5e2ffc936784cda202a35d4f6204b5d /convert.c
parentcd2b8ae983a277fb3f3c2b2c6747b0a075af1421 (diff)
downloadgit-7732118438764cfe49b8e0ad2c63e6dc97be45ed.tar.gz
Use memmove in ident_to_git
convert_to_git sets src=dst->buf if any of the preceding conversions actually did any work. Thus in ident_to_git we have to use memmove instead of memcpy as far as src->dst copying is concerned. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'convert.c')
-rw-r--r--convert.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/convert.c b/convert.c
index efc7e07d47..893b105adb 100644
--- a/convert.c
+++ b/convert.c
@@ -533,7 +533,7 @@ static int ident_to_git(const char *path, const char *src, size_t len,
dollar = memchr(src, '$', len);
if (!dollar)
break;
- memcpy(dst, src, dollar + 1 - src);
+ memmove(dst, src, dollar + 1 - src);
dst += dollar + 1 - src;
len -= dollar + 1 - src;
src = dollar + 1;
@@ -553,7 +553,7 @@ static int ident_to_git(const char *path, const char *src, size_t len,
src = dollar + 1;
}
}
- memcpy(dst, src, len);
+ memmove(dst, src, len);
strbuf_setlen(buf, dst + len - buf->buf);
return 1;
}