summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
diff options
context:
space:
mode:
author R. Belmont <rb6502@users.noreply.github.com>2011-05-01 01:00:21 +0000
committer R. Belmont <rb6502@users.noreply.github.com>2011-05-01 01:00:21 +0000
commit70c52a193b6fccc22562e1391125e31b23e1d182 (patch)
tree9ddbedc0cc237451d39924acee2461e7e4403d3d /src/lib
parent656c24bb25ba07ccd5a5828b8cd23e1793f60062 (diff)
astring: don't copy a pointer onto itself (not harmful, but annoying in Valgrind) (no whatsnew)
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/util/astring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/util/astring.c b/src/lib/util/astring.c
index 64382876732..9a2507ca313 100644
--- a/src/lib/util/astring.c
+++ b/src/lib/util/astring.c
@@ -280,7 +280,7 @@ astring *astring_cpych(astring *dst, const char *src, int count)
return dst;
/* copy the raw data and NULL-terminate */
- if (count > 0)
+ if ((count > 0) && (dst->text != src))
memcpy(dst->text, src, count);
dst->text[count] = 0;
return dst;