diff options
Diffstat (limited to 'editbox2.cc')
-rw-r--r-- | editbox2.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/editbox2.cc b/editbox2.cc index 2d055ea..76c4aaa 100644 --- a/editbox2.cc +++ b/editbox2.cc @@ -15,6 +15,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. #include <config.h> +#include <stdlib.h> #include "editbox.h" #include "transtbl.h" @@ -1616,11 +1617,12 @@ void EditBox::log2vis(const char *options) opt_nopad = true; if (strstr(options, "engpad")) opt_engpad = true; - char *s; - if ((s = strstr(options, "emph"))) { + const char *s; + // FIXME: The following writes on s, which is in the read-only buffer options. + if (s = strstr(options, "emph")) { opt_emph = true; if (s[4] == ':') { - opt_emph_ch = strtol(s + 5, &s, 0); + opt_emph_ch = strtol(s + 5, (char**)&s, 0); // FIXME: Brute force. Tzafrir if (s && (*s == ':' || *s == ',')) opt_emph_marker = strtol(s + 1, NULL, 0); } |