[Midnightbsd-cvs] src [7742] trunk/lib/libmport/bundle_read_install_pkg.c: fix mode logic

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Aug 14 23:16:50 EDT 2016


Revision: 7742
          http://svnweb.midnightbsd.org/src/?rev=7742
Author:   laffer1
Date:     2016-08-14 23:16:50 -0400 (Sun, 14 Aug 2016)
Log Message:
-----------
fix mode logic

Modified Paths:
--------------
    trunk/lib/libmport/bundle_read_install_pkg.c

Modified: trunk/lib/libmport/bundle_read_install_pkg.c
===================================================================
--- trunk/lib/libmport/bundle_read_install_pkg.c	2016-08-15 02:47:04 UTC (rev 7741)
+++ trunk/lib/libmport/bundle_read_install_pkg.c	2016-08-15 03:16:50 UTC (rev 7742)
@@ -301,11 +301,7 @@
 			const unsigned char *group = sqlite3_column_text(stmt, 4);
 			const unsigned char *mode = sqlite3_column_text(stmt, 5);
 
-			if (data == NULL) {
-				e->data = strdup(""); /* needs to be empty string */	
-			} else {
-				e->data = strdup((char *) data);
-			}
+			e->data = data == NULL ? NULL : strdup((char *) data);
 			if (checksum != NULL)
 				e->checksum = strdup((char *) checksum);
 			if (owner != NULL)



More information about the Midnightbsd-cvs mailing list