about summary refs log tree commit diff
path: root/src/base/system.h
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2010-08-12 15:22:07 +0200
committeroy <Tom_Adams@web.de>2010-08-12 15:22:07 +0200
commit7503c642379cec7a2e14fe6a516d69a1f4d6d94a (patch)
tree7c10ada1c341c67669cccdc7ae6f261ae3d103a6 /src/base/system.h
parent1cde96ef79a8418a9c34f355ec49d08f1e654213 (diff)
downloadzcatch-7503c642379cec7a2e14fe6a516d69a1f4d6d94a.tar.gz
zcatch-7503c642379cec7a2e14fe6a516d69a1f4d6d94a.zip
made unpacking of net strings more strict - prevents possible malformed output
Diffstat (limited to 'src/base/system.h')
-rw-r--r--src/base/system.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/base/system.h b/src/base/system.h
index 0850a08b..c49fbdad 100644
--- a/src/base/system.h
+++ b/src/base/system.h
@@ -732,9 +732,21 @@ void str_format(char *buffer, int buffer_size, const char *format, ...);
 void str_sanitize_strong(char *str);
 
 /*
+	Function: str_sanitize_cc
+		Replaces all characters below 32 with whitespace.
+	
+	Parameters:
+		str - String to sanitize.
+
+	Remarks:
+		- The strings are treated as zero-termineted strings.
+*/
+void str_sanitize_cc(char *str);
+
+/*
 	Function: str_sanitize
-		Replaces all characters below 32 and above 127 with whitespace with
-		exception to \r, \n and \r.
+		Replaces all characters below 32 with whitespace with
+		exception to \t, \n and \r.
 	
 	Parameters:
 		str - String to sanitize.
@@ -745,6 +757,22 @@ void str_sanitize_strong(char *str);
 void str_sanitize(char *str);
 
 /*
+	Function: str_skip_whitespaces
+		Skips leading whitespace characters(' ', '\t', '\n', '\r').
+	
+	Parameters:
+		str - Pointer to the string.
+
+	Returns:
+		Pointer to the first non-whitespace character found
+		within the string.
+
+	Remarks:
+		- The strings are treated as zero-termineted strings.
+*/
+char *str_skip_whitespaces(char *str);
+
+/*
 	Function: str_comp_nocase
 		Compares to strings case insensitive.