/*
* Functions necessary to handle pandoc URLs.
- * Copyright (C) 2014 Michael Goehler
+ * Copyright (C) 2016 Michael Goehler
*
* This file is part of mdp.
*
for (; *i; i++) {
if (*i == '\\') {
i++;
- } else if ( *i == '[' && *(i+1) != ']') {
+ } else if ( *i == '[' && *(i+1) && *(i+1) != ']') {
while (*i && *i != ']') i++;
i++;
if (*i == '(' && wcschr(i, ')')) {
for (; *i; i++) {
if (*i == '\\') {
i++;
- } else if ( *i == '[' && *(i+1) != ']') {
+ } else if ( *i == '[' && *(i+1) && *(i+1) != ']') {
while (*i && *i != ']') i++;
i++;
if (*i == '(' && wcschr(i, ')')) {