From 437c6ded80e7f56d88e7fd4f1cda067cf3360551 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 17 Apr 2009 16:46:34 +0000 Subject: [PATCH] * Don't attempt to evaluate (ptr-1) when ptr is already at the beginning of the buffer. --- webcit/html2html.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webcit/html2html.c b/webcit/html2html.c index c1c2b64a5..289a7e51f 100644 --- a/webcit/html2html.c +++ b/webcit/html2html.c @@ -502,10 +502,10 @@ void output_html(const char *supplied_charset, int treat_as_wiki, int msgnum, St * so we don't turn things that look like URL's into * links, when they're already links - or image sources. */ - if (*(ptr-1) == '<') { + if ((ptr > msg) && (*(ptr-1) == '<')) { ++brak; } - if (*(ptr-1) == '>') { + if ((ptr > msg) && (*(ptr-1) == '>')) { --brak; if ((scriptlevel == 0) && (script_start_pos >= 0)) { StrBufCutRight(converted_msg, StrLength(converted_msg) - script_start_pos); -- 2.30.2