From 206df688ba0683a9afdf99b0f0ff5e8767452164 Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Wed, 7 Sep 2011 12:48:35 +0000 Subject: [PATCH] Fix mircansi() so that it properly handles non-numeric characters after a comma. git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@140 13b04d17-f746-0410-82c6-800466cd88b0 --- Changelog | 2 ++ source/misc.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 6b7907d..ca7a4fd 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,7 @@ [Changes 1.2c01] +* Fix crash bug in $mircansi() scripting function. (caf) + * Add half-op support to /topic and /untopic. (caf) * Tidy up the URL grabber, fixing a memory leak. (caf) diff --git a/source/misc.c b/source/misc.c index 8d5c563..2cd5ce1 100644 --- a/source/misc.c +++ b/source/misc.c @@ -998,7 +998,7 @@ struct { if (code > 15 || code <= 0) code = code % 16; strcpy(dptr, codes[code].fg); while (*dptr) dptr++; - if (*sptr == ',') + if (*sptr == ',' && isdigit(sptr[1])) { sptr++; code = *sptr - '0';