Fixed crash caused by invalid pandoc urls
[smdp.git] / src / viewer.c
index 97e62df..1b2e6b9 100644 (file)
@@ -2,7 +2,7 @@
  * Functions necessary to display a deck of slides in different color modes
  * using ncurses. Only white, red, and blue are supported, as they can be
  * faded in 256 color mode.
- * Copyright (C) 2014 Michael Goehler
+ * Copyright (C) 2015 Michael Goehler
  *
  * This file is part of mdp.
  *
@@ -713,7 +713,7 @@ void inline_display(WINDOW *window, const wchar_t *c, const int colors) {
 
                         if (*i == L'!') i++;
 
-                        if (wcschr(i, L']')[1] == L'(') {
+                        if (wcschr(i, L']')[1] == L'(' && wcschr(i, L')')) {
                             i++;
 
                             // turn higlighting and underlining on