From: Art Cancro Date: Fri, 17 Apr 2009 16:46:34 +0000 (+0000) Subject: * Don't attempt to evaluate (ptr-1) when ptr is already at the beginning of the buffer. X-Git-Tag: v7.86~1250 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=437c6ded80e7f56d88e7fd4f1cda067cf3360551 * Don't attempt to evaluate (ptr-1) when ptr is already at the beginning of the buffer. --- 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);