@@ -16,13 +16,13 @@ int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
1616 utf8proc_ssize_t ret , bytes = 0 ;
1717 utf8proc_uint8_t * str = NULL ;
1818 size_t len = strlen ((const char * )data );
19-
19+
2020 while (bytes != len )
2121 {
2222 ret = utf8proc_iterate (ptr , -1 , & c );
23-
23+
2424 if (ret < 0 || ret == 0 ) break ;
25-
25+
2626 bytes += ret ;
2727 ptr += ret ;
2828
@@ -35,31 +35,31 @@ int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
3535 utf8proc_category (c );
3636 utf8proc_category_string (c );
3737 utf8proc_codepoint_valid (c );
38-
38+
3939 utf8proc_grapheme_break (c_prev , c );
4040 utf8proc_grapheme_break_stateful (c_prev , c , & state );
41-
41+
4242 c_prev = c ;
4343 }
44-
44+
4545 utf8proc_int32_t * copy = size >= 4 ? NULL : malloc (size );
46-
46+
4747 if (copy )
4848 {
4949 size /= 4 ;
50-
50+
5151 options = UTF8PROC_STRIPCC | UTF8PROC_NLF2LS | UTF8PROC_NLF2PS ;
5252 memcpy (copy , data , size );
5353 utf8proc_normalize_utf32 (copy , size , options );
54-
54+
5555 options = UTF8PROC_STRIPCC | UTF8PROC_NLF2LS ;
5656 memcpy (copy , data , size );
5757 utf8proc_normalize_utf32 (copy , size , options );
58-
58+
5959 options = UTF8PROC_STRIPCC | UTF8PROC_NLF2PS ;
6060 memcpy (copy , data , size );
6161 utf8proc_normalize_utf32 (copy , size , options );
62-
62+
6363 options = UTF8PROC_STRIPCC ;
6464 memcpy (copy , data , size );
6565 utf8proc_normalize_utf32 (copy , size , options );
@@ -71,30 +71,30 @@ int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
7171 options = 0 ;
7272 memcpy (copy , data , size );
7373 utf8proc_normalize_utf32 (copy , size , options );
74-
74+
7575 free (copy );
7676 }
7777
78- free (utf8proc_NFD (data ));
79- free (utf8proc_NFC (data ));
80- free (utf8proc_NFKD (data ));
81- free (utf8proc_NFKC (data ));
82- free (utf8proc_NFKC_Casefold (data ));
78+ utf8proc_free (utf8proc_NFD (data ));
79+ utf8proc_free (utf8proc_NFC (data ));
80+ utf8proc_free (utf8proc_NFKD (data ));
81+ utf8proc_free (utf8proc_NFKC (data ));
82+ utf8proc_free (utf8proc_NFKC_Casefold (data ));
8383
8484 utf8proc_map (data , len , & str , UTF8PROC_CHARBOUND | UTF8PROC_STRIPNA );
85- free (str );
85+ utf8proc_free (str );
8686
8787 utf8proc_map (data , len , & str , UTF8PROC_LUMP | UTF8PROC_NLF2LS | UTF8PROC_NLF2PS );
88- free (str );
88+ utf8proc_free (str );
8989
9090 utf8proc_map (data , len , & str , UTF8PROC_COMPOSE | UTF8PROC_STRIPMARK );
91- free (str );
91+ utf8proc_free (str );
9292
9393 utf8proc_map (data , len , & str , UTF8PROC_CHARBOUND | UTF8PROC_DECOMPOSE );
94- free (str );
94+ utf8proc_free (str );
9595
9696 utf8proc_map (data , len , & str , UTF8PROC_CHARBOUND | UTF8PROC_COMPOSE );
97- free (str );
97+ utf8proc_free (str );
9898
9999 return 0 ;
100100}
0 commit comments