This removes a potential read beyond the end of the buffer, which was introduced in 08b0f2c3c76098cb34146a20e0d6228d2a2ccf09 and became more likely to trigger due to the additional call to is_codefence introduced in 9ced48b4880d2ed55415b7ddd43e36030462abaa.
Apart from this I am tackling the huge list of compiler warnings that I get on my system (Debian testing, libc6 2.30, gcc 4:9.2.1). Some of them are minor but annoying, for example a huge list of signedness mismatches for string literal arguments. Some of them are more serious, such as implicitly defined functions. With these changes, the code compiles for me without a single warning.
I'm also including a minor readability improvement suggested by Jonas Wagner.
This removes a potential read beyond the end of the buffer, which was introduced in 08b0f2c3c76098cb34146a20e0d6228d2a2ccf09 and became more likely to trigger due to the additional call to
is_codefence
introduced in 9ced48b4880d2ed55415b7ddd43e36030462abaa.Apart from this I am tackling the huge list of compiler warnings that I get on my system (Debian testing, libc6 2.30, gcc 4:9.2.1). Some of them are minor but annoying, for example a huge list of signedness mismatches for string literal arguments. Some of them are more serious, such as implicitly defined functions. With these changes, the code compiles for me without a single warning.
I'm also including a minor readability improvement suggested by Jonas Wagner.