Currently, all places where append_serve() is called from, ensure that
the server argument is never NULL.

Furthermore,

- exiting on error inside a "util" function is bad practice, it makes it
  almost impossible to use the function from other code paths

- appending NULL server does not make any sense, therefore checking for
  NULL is pointless, it's a programmer error to call append_serve() with
  NULL

Signed-off-by: Tuomas Räsänen <[email protected]>
---
 nbd-server.c |    3 ---
 1 file changed, 3 deletions(-)

diff --git a/nbd-server.c b/nbd-server.c
index 27c4600..554c423 100644
--- a/nbd-server.c
+++ b/nbd-server.c
@@ -710,9 +710,6 @@ int append_serve(const SERVER *const s, GArray *const a) {
        int e;
        int ret;
 
-       if(!s)
-               err("Invalid parsing server");
-
        port = g_strdup_printf("%d", s->port);
 
        memset(&hints,'\0',sizeof(hints));
-- 
1.7.10.4


------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Nbd-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nbd-general

Reply via email to