commit 1fec047bf80383e5513057bd74a9c9008047672c
parent 2ba1b2e9d06ac7c3504e43d2fec8c81b8b680c98
Author: Robin <kroekerrobin@gmail.com>
Date: Sat, 24 Feb 2024 19:10:01 +0100
Improve a little bit
Diffstat:
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/html.c b/html.c
@@ -173,13 +173,12 @@ static inline bool isValidAttrName(uint_least32_t cp)
return true;
}
-static inline bool
-isValidUnquotedAttrValue(uint_least32_t cp)
+static inline bool isValidUnquotedAttrValue(uint_least32_t cp)
{
/*
Not mentioned invalid characters.
They are already handled before
- funtion call.
+ function call.
*/
if (
cp == EQUALS_SIGN ||
@@ -383,6 +382,7 @@ char *encodeNamedCharRef(const char *name)
{
char *buf = malloc(2*MAX_CODEPOINT_SIZE+1);
char cp[MAX_CODEPOINT_SIZE];
+ memset(&cp, 0, MAX_CODEPOINT_SIZE);
size_t len;
for (int i=0; i<NAMED_CHAR_REF_COUNT; i++)
{
diff --git a/lib.c b/lib.c
@@ -10,13 +10,9 @@ char *stringCat(char *str1, char *str2)
int i = 0;
int k = 0;
for (; i<str1Len; i++)
- {
string[i] = str1[i];
- }
for (; k<str2Len; k++)
- {
string[i+k] = str2[k];
- }
string[i+k] = '\0';
free(str1);
free(str2);