From 68d47de87a8f4cda2d7d50bb3a6291528d48b333 Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Fri, 14 Dec 2001 17:10:54 +0000 Subject: [w3m-dev 02656] From: Kiyokazu SUTO --- anchor.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'anchor.c') diff --git a/anchor.c b/anchor.c index 02e7ef1..d54f827 100644 --- a/anchor.c +++ b/anchor.c @@ -1,4 +1,4 @@ -/* $Id: anchor.c,v 1.6 2001/11/24 02:01:26 ukai Exp $ */ +/* $Id: anchor.c,v 1.7 2001/12/14 17:10:54 ukai Exp $ */ #include "fm.h" #include "myctype.h" #include "regex.h" @@ -185,14 +185,14 @@ searchURLLabel(Buffer *buf, char *url) static Anchor * _put_anchor_news(Buffer *buf, char *p1, char *p2, int line, int pos) { - Str tmp = Strnew_charp("news:"); + Str tmp; p1++; if (*(p2 - 1) == '>') p2--; - while (p1 < p2) { - Strcat_char(tmp, *(p1++)); - } + tmp = Strnew_size(sizeof("news:") - 1 + (p2 - p1)); + Strcat_charp_n(tmp, "news:", sizeof("news:") - 1); + Strcat_charp_n(tmp, p1, p2 - p1); return registerHref(buf, tmp->ptr, NULL, NO_REFERER, line, pos); } #endif /* USE_NNTP */ -- cgit v1.2.3