Skip to content

Commit e1f3420

Browse files
removed soap
1 parent dc0cee3 commit e1f3420

File tree

2 files changed

+6
-24
lines changed

2 files changed

+6
-24
lines changed

code/logic/input.c

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
* -----------------------------------------------------------------------------
1313
*/
1414
#include "fossil/io/input.h"
15-
#include "fossil/io/soap.h"
1615
#include "fossil/io/output.h"
1716

1817
#include <ctype.h>
@@ -54,7 +53,7 @@ void fossil_io_trim(char *str) {
5453
// Function to get a sanitized line of input from a provided stream (or stdin by default)
5554
char *fossil_io_gets_from_stream(char *buf, size_t size, FILE *input_stream) {
5655
if (buf == NULL || size == 0 || input_stream == NULL) {
57-
fprintf(stderr, "Error: Invalid buffer or stream\n");
56+
fprintf(stderr, "Error: Invalid buffer or stream.\n");
5857
return NULL;
5958
}
6059

@@ -63,7 +62,7 @@ char *fossil_io_gets_from_stream(char *buf, size_t size, FILE *input_stream) {
6362
if (feof(input_stream)) {
6463
return NULL; // End of file reached
6564
}
66-
fprintf(stderr, "Error: Failed to read from input stream\n");
65+
fprintf(stderr, "Error: Failed to read from input stream.\n");
6766
return NULL;
6867
}
6968

@@ -73,9 +72,6 @@ char *fossil_io_gets_from_stream(char *buf, size_t size, FILE *input_stream) {
7372
buf[len - 1] = '\0'; // Remove the newline character
7473
}
7574

76-
// Sanitize the input buffer
77-
fossil_soap_sanitize(buf);
78-
7975
// Trim any leading or trailing whitespace
8076
fossil_io_trim(buf);
8177

@@ -84,7 +80,7 @@ char *fossil_io_gets_from_stream(char *buf, size_t size, FILE *input_stream) {
8480

8581
char *fossil_io_gets_from_stream_ex(char *buf, size_t size, FILE *input_stream, int *error_code) {
8682
if (buf == NULL || size == 0 || input_stream == NULL || error_code == NULL) {
87-
fprintf(stderr, "Error: Invalid buffer, stream, or error code\n");
83+
fprintf(stderr, "Error: Invalid buffer, stream, or error code.\n");
8884
return NULL;
8985
}
9086

@@ -95,7 +91,7 @@ char *fossil_io_gets_from_stream_ex(char *buf, size_t size, FILE *input_stream,
9591
return NULL; // End of file reached
9692
}
9793
*error_code = ferror(input_stream);
98-
fprintf(stderr, "Error: Failed to read from input stream\n");
94+
fprintf(stderr, "Error: Failed to read from input stream.\n");
9995
return NULL;
10096
}
10197

@@ -105,9 +101,6 @@ char *fossil_io_gets_from_stream_ex(char *buf, size_t size, FILE *input_stream,
105101
buf[len - 1] = '\0'; // Remove the newline character
106102
}
107103

108-
// Sanitize the input buffer
109-
fossil_soap_sanitize(buf);
110-
111104
// Trim any leading or trailing whitespace
112105
fossil_io_trim(buf);
113106

@@ -132,7 +125,7 @@ int fossil_io_fscanf(FILE *input_stream, const char *format, ...) {
132125

133126
int fossil_io_validate_input_buffer(const char *buf, size_t size) {
134127
if (buf == NULL || size == 0) {
135-
fprintf(stderr, "Error: Invalid buffer or size\n");
128+
fprintf(stderr, "Error: Invalid buffer or size.\n");
136129
return 0;
137130
}
138131
return 1;
@@ -148,7 +141,7 @@ char *fossil_io_gets_utf8(char *buf, size_t size, FILE *input_stream) {
148141
if (feof(input_stream)) {
149142
return NULL; // End of file reached
150143
}
151-
fprintf(stderr, "Error: Failed to read from input stream\n");
144+
fprintf(stderr, "Error: Failed to read from input stream.\n");
152145
return NULL;
153146
}
154147

@@ -158,9 +151,6 @@ char *fossil_io_gets_utf8(char *buf, size_t size, FILE *input_stream) {
158151
buf[len - 1] = '\0'; // Remove the newline character
159152
}
160153

161-
// Sanitize the input buffer
162-
fossil_soap_sanitize(buf);
163-
164154
// Trim any leading or trailing whitespace
165155
fossil_io_trim(buf);
166156

@@ -250,9 +240,6 @@ int fossil_io_validate_sanitize_string(const char *input, char *output, size_t o
250240
// Copy the input string to the output buffer
251241
strncpy(output, input, output_size);
252242

253-
// Sanitize the output buffer
254-
fossil_soap_sanitize(output);
255-
256243
return 1;
257244
}
258245

code/logic/output.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
* -----------------------------------------------------------------------------
1313
*/
1414
#include "fossil/io/output.h"
15-
#include "fossil/io/soap.h"
1615

1716
#include <stdio.h>
1817
#include <stdarg.h>
@@ -136,7 +135,6 @@ void fossil_io_puts(const char *str) {
136135
char sanitized_str[FOSSIL_IO_BUFFER_SIZE];
137136
strncpy(sanitized_str, str, sizeof(sanitized_str));
138137
sanitized_str[sizeof(sanitized_str) - 1] = '\0'; // Ensure null termination
139-
fossil_soap_sanitize(sanitized_str);
140138

141139
// Print the sanitized string with attributes
142140
fossil_io_print_with_attributes(sanitized_str);
@@ -164,9 +162,6 @@ void fossil_io_printf(const char *format, ...) {
164162
char buffer[FOSSIL_IO_BUFFER_SIZE];
165163
vsnprintf(buffer, sizeof(buffer), format, args);
166164

167-
// Sanitize the buffer
168-
fossil_soap_sanitize(buffer);
169-
170165
// Print the sanitized output with attributes
171166
fossil_io_print_with_attributes(buffer);
172167

0 commit comments

Comments
 (0)