summaryrefslogtreecommitdiff
path: root/Build/source/texk/xdvik/hypertex.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/xdvik/hypertex.c')
-rw-r--r--Build/source/texk/xdvik/hypertex.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Build/source/texk/xdvik/hypertex.c b/Build/source/texk/xdvik/hypertex.c
index 736ae4b0b3c..2cb55d07406 100644
--- a/Build/source/texk/xdvik/hypertex.c
+++ b/Build/source/texk/xdvik/hypertex.c
@@ -902,7 +902,7 @@ add_anchor(struct htex_page_info *info, htexAnchorT type,
if (str[0] != '#') {
info->anchors[info->curr_cnt].a_href = xmalloc(len + 2);
strcpy(info->anchors[info->curr_cnt].a_href, "#");
- strncat(info->anchors[info->curr_cnt].a_href, str, len);
+ memcpy(info->anchors[info->curr_cnt].a_href + 1, str, len);
info->anchors[info->curr_cnt].a_href[len + 1] = '\0';
}
else {
@@ -924,7 +924,8 @@ add_anchor(struct htex_page_info *info, htexAnchorT type,
else {
info->anchors[info->curr_cnt].a_href = xmalloc(len + strlen("file:") + 1);
strcpy(info->anchors[info->curr_cnt].a_href, "file:");
- strncat(info->anchors[info->curr_cnt].a_href, str, len);
+ memcpy(info->anchors[info->curr_cnt].a_href + strlen("file:"),
+ str, len);
info->anchors[info->curr_cnt].a_href[len + strlen("file:")] = '\0';
}
}