small code-style and "malloc" -> "realloc" - smu - smu - simple markup (Markdown) processor (fork, fixes + features)
 (HTM) git clone git://git.codemadness.org/smu
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 2a2b8581a3302d94a9d9d461b7c4ef882c58ab86
 (DIR) parent 9c68585ed395bc9db7339433746ec0dd8298cabc
 (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
       Date:   Thu, 13 May 2021 14:41:13 +0200
       
       small code-style and "malloc" -> "realloc"
       
       Diffstat:
         M smu.c                               |       4 ++--
       
       1 file changed, 2 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/smu.c b/smu.c
       @@ -12,7 +12,7 @@
        #endif
        
        #define LENGTH(x)  sizeof(x)/sizeof(x[0])
       -#define ADDC(b,i)  if (i % BUFSIZ == 0) { b = realloc(b, (i + BUFSIZ)); if (!b) eprint("malloc"); } b[i]
       +#define ADDC(b,i)  if (i % BUFSIZ == 0) { b = realloc(b, (i + BUFSIZ)); if (!b) eprint("realloc"); } b[i]
        
        typedef int (*Parser)(const char *, const char *, int);
        typedef struct {
       @@ -565,7 +565,7 @@ dosurround(const char *begin, const char *end, int newblock)
                        do {
                                stop = p;
                                p = strstr(p + 1, surround[i].search);
       -                } while(p && p[-1] == '\\');
       +                } while (p && p[-1] == '\\');
                        if (p && p[-1] != '\\')
                                stop = p;
                        if (!stop || stop < start || stop >= end)