when not providing an --input or --output, stdin and stdout are used. Also the c2html function outputs the length of the string

This commit is contained in:
cozis
2022-05-09 04:40:07 +02:00
parent df99e96361
commit e3a9c895cc
4 changed files with 117 additions and 68 deletions
+5 -2
View File
@@ -487,8 +487,8 @@ static void print_escaped(buff_t *buff, const char *str, long len)
}
}
char *c2html(const char *str, long len,
const char *prefix, const char **error)
char *c2html(const char *str, long len, const char *prefix,
long *output_len, const char **error)
{
if(str == NULL)
str = "";
@@ -639,6 +639,9 @@ char *c2html(const char *str, long len,
res = NULL;
}
if(output_len != NULL)
*output_len = buff.used;
free(tokens);
return res;
}