diff options
-rw-r--r-- | src/blocks.c | 2 | ||||
-rw-r--r-- | src/buffer.c | 20 | ||||
-rw-r--r-- | src/houdini_html_u.c | 2 | ||||
-rw-r--r-- | src/html.c | 4 | ||||
-rw-r--r-- | src/utf8.c | 6 |
5 files changed, 17 insertions, 17 deletions
diff --git a/src/blocks.c b/src/blocks.c index 2a68f75..8c3e18c 100644 --- a/src/blocks.c +++ b/src/blocks.c @@ -613,7 +613,7 @@ S_process_line(cmark_parser *parser, const unsigned char *buffer, bufsize_t byte if (parser->indent >= container->as.list.marker_offset + container->as.list.padding) { parser->offset += container->as.list.marker_offset + - container->as.list.padding; + container->as.list.padding; } else if (parser->blank) { parser->offset = parser->first_nonspace; } else { diff --git a/src/buffer.c b/src/buffer.c index 7d16af8..e07fba6 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -29,18 +29,20 @@ void cmark_strbuf_init(cmark_strbuf *buf, bufsize_t initial_size) cmark_strbuf_grow(buf, initial_size); } -void cmark_strbuf_overflow_err() { +void cmark_strbuf_overflow_err() +{ fprintf(stderr, "String buffer overflow"); abort(); } static inline void -S_strbuf_grow_by(cmark_strbuf *buf, size_t add) { +S_strbuf_grow_by(cmark_strbuf *buf, size_t add) +{ size_t target_size = (size_t)buf->size + add; if (target_size < add /* Integer overflow. */ || target_size > BUFSIZE_MAX /* Truncation overflow. */ - ) { + ) { cmark_strbuf_overflow_err(); return; /* unreachable */ } @@ -74,7 +76,7 @@ void cmark_strbuf_grow(cmark_strbuf *buf, bufsize_t target_size) if (new_size < (size_t)target_size /* Integer overflow. */ || new_size > BUFSIZE_MAX /* Truncation overflow. */ - ) { + ) { if (target_size >= BUFSIZE_MAX) { /* No space for terminating null byte. */ cmark_strbuf_overflow_err(); @@ -160,7 +162,7 @@ void cmark_strbuf_put(cmark_strbuf *buf, const unsigned char *data, bufsize_t le void cmark_strbuf_puts(cmark_strbuf *buf, const char *string) { cmark_strbuf_put(buf, (const unsigned char *)string, - cmark_strbuf_safe_strlen(string)); + cmark_strbuf_safe_strlen(string)); } void cmark_strbuf_vprintf(cmark_strbuf *buf, const char *format, va_list ap) @@ -175,10 +177,10 @@ void cmark_strbuf_vprintf(cmark_strbuf *buf, const char *format, va_list ap) va_copy(args, ap); int len = vsnprintf( - (char *)buf->ptr + buf->size, - buf->asize - buf->size, - format, args - ); + (char *)buf->ptr + buf->size, + buf->asize - buf->size, + format, args + ); #ifndef HAVE_C99_SNPRINTF // Assume we're on Windows. if (len < 0) { diff --git a/src/houdini_html_u.c b/src/houdini_html_u.c index 6f94c23..c8e4b93 100644 --- a/src/houdini_html_u.c +++ b/src/houdini_html_u.c @@ -29,7 +29,7 @@ S_lookup(int i, unsigned long key) return cmark_entities[i].bytes; } else { int next = key < cmark_entities[i].value ? - cmark_entities[i].less : cmark_entities[i].greater; + cmark_entities[i].less : cmark_entities[i].greater; if (next == 0) { return NULL; } else { @@ -251,7 +251,7 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, if (entering) { cmark_strbuf_puts(html, "<a href=\""); houdini_escape_href(html, node->as.link.url.data, - node->as.link.url.len); + node->as.link.url.len); if (node->as.link.title.len) { cmark_strbuf_puts(html, "\" title=\""); @@ -269,7 +269,7 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, if (entering) { cmark_strbuf_puts(html, "<img src=\""); houdini_escape_href(html, node->as.link.url.data, - node->as.link.url.len); + node->as.link.url.len); cmark_strbuf_puts(html, "\" alt=\""); state->plain = node; @@ -134,14 +134,12 @@ void utf8proc_detab(cmark_strbuf *ob, const uint8_t *line, bufsize_t size) break; } i += charlen; - } - else if (line[i] == '\0') { + } else if (line[i] == '\0') { // ASCII NUL is technically valid but rejected // for security reasons. charlen = 1; break; - } - else { + } else { i++; } |