Commit 539e732b6a9025ac6325fff23c33b25a19cd9445

Timothy Gu 2014-01-22T04:12:43

Fix error checking in copy_string()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/dlfcn.c b/dlfcn.c
index fa88d83..f7c1cb8 100644
--- a/dlfcn.c
+++ b/dlfcn.c
@@ -113,7 +113,7 @@ static int copy_string( char *dest, int dest_size, const char *src )
     int i = 0;
 
     /* gcc should optimize this out */
-    if( !src && !dest )
+    if( !src || !dest )
         return 0;
 
     for( i = 0 ; i < dest_size-1 ; i++ )