File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ static void replace_substring_case_insensitive(char *str, const char *old_substr
106106}
107107
108108void fossil_soap_sanitize (char * input ) {
109- if (input == NULL ) return ;
109+ if (input == NULL || * input == '\0' ) return ;
110110
111111 // Perform single-threaded sanitization
112112 for (size_t i = 0 ; i < sizeof (offensive_words ) / sizeof (offensive_words [0 ]); ++ i ) {
@@ -118,7 +118,7 @@ void fossil_soap_sanitize(char *input) {
118118
119119// Function to check if a word is an offensive word or phrase
120120int32_t fossil_soap_is_offensive (const char * word ) {
121- if (word == NULL ) return EXIT_SUCCESS ;
121+ if (word == NULL || * word == '\0' ) return EXIT_SUCCESS ;
122122
123123 for (size_t i = 0 ; i < sizeof (offensive_words ) / sizeof (offensive_words [0 ]); ++ i ) {
124124 if (strcasecmp (word , offensive_words [i ]) == 0 ) {
@@ -130,7 +130,7 @@ int32_t fossil_soap_is_offensive(const char *word) {
130130
131131// Function to get the number of offensive words found in a string
132132int32_t fossil_soap_count_offensive (const char * input ) {
133- if (input == NULL ) return 0 ;
133+ if (input == NULL || * input == '\0' ) return 0 ;
134134
135135 int count = 0 ;
136136 char * copy = _custom_fossil_strdup (input );
You can’t perform that action at this time.
0 commit comments