git » libfiu » commit 45149a8

preload/posix: Remove unnecessary "if (stream == NULL)" checks

author Alberto Bertogli
2018-10-01 08:16:52 UTC
committer Alberto Bertogli
2018-10-14 20:11:19 UTC
parent fc8ccf3741bb61527a02f4acfe251ae6b9cd548e

preload/posix: Remove unnecessary "if (stream == NULL)" checks

They're a leftover from previous code.

Thanks to Ian Blanes for the suggestion!

preload/posix/modules/posix.custom.c +0 -9

diff --git a/preload/posix/modules/posix.custom.c b/preload/posix/modules/posix.custom.c
index 18d01d0..e6eea8f 100644
--- a/preload/posix/modules/posix.custom.c
+++ b/preload/posix/modules/posix.custom.c
@@ -224,9 +224,6 @@ static void stream_to_key(void *stream, char key[STREAM_KEY_SIZE])
 
 void set_ferror(void * stream)
 {
-	if (stream == NULL)
-		return;
-
 	char key[STREAM_KEY_SIZE];
 	stream_to_key(stream, key);
 
@@ -241,9 +238,6 @@ void set_ferror(void * stream)
 
 static int get_ferror(void * stream)
 {
-	if (stream == NULL)
-		return 1;
-
 	char key[STREAM_KEY_SIZE];
 	stream_to_key(stream, key);
 
@@ -258,9 +252,6 @@ static int get_ferror(void * stream)
 
 static void clear_ferror(void * stream)
 {
-	if (stream == NULL)
-		return;
-
 	char key[STREAM_KEY_SIZE];
 	stream_to_key(stream, key);