[Midnightbsd-cvs] src [12203] trunk/lib/libmport/bundle_read_install_pkg.c: do not treat it as a pattern

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun May 26 13:08:16 EDT 2019


Revision: 12203
          http://svnweb.midnightbsd.org/src/?rev=12203
Author:   laffer1
Date:     2019-05-26 13:08:16 -0400 (Sun, 26 May 2019)
Log Message:
-----------
do not treat it as a pattern

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	2019-05-26 15:29:11 UTC (rev 12202)
+++ trunk/lib/libmport/bundle_read_install_pkg.c	2019-05-26 17:08:16 UTC (rev 12203)
@@ -956,7 +956,7 @@
 	if ((buf = (char *) calloc((size_t) (st.st_size + 1), sizeof(char))) == NULL)
 		RETURN_ERROR(MPORT_ERR_FATAL, "Out of memory.");
 
-	if (fread(buf, 1, (size_t) st.st_size, file) != (size_t) st.st_size) {
+	if (fread(buf, sizeof(char), (size_t) st.st_size, file) != (size_t) st.st_size) {
 		free(buf);
 		RETURN_ERRORX(MPORT_ERR_FATAL, "Read error: %s", strerror(errno));
 	}
@@ -964,7 +964,7 @@
 	buf[st.st_size] = '\0';
 
 	if (buf[0] != '\0')
-		mport_call_msg_cb(mport, buf);
+		mport_call_msg_cb(mport, "%s", buf);
 
 	free(buf);
 



More information about the Midnightbsd-cvs mailing list