Permalink
Browse files

Merge pull request #6 from hukl/master

Fixed a compiler error on FreeBSD and corrected wrong integer type
  • Loading branch information...
2 parents cdff940 + 0352ab8 commit ed59619f4719c164e90f37ca9c19f7f50f0a6dc5 @Vagabond committed Dec 12, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 c_src/syslog_drv.c
View
@@ -21,7 +21,7 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
+#include <stdint.h>
#include <syslog.h>
#include <stdarg.h>
#include <string.h>
@@ -89,7 +89,7 @@ static void syslogdrv_output(ErlDrvData handle, char *buf, ErlDrvSizeT len)
as a 4-byte integer in network order, therefore make sure there's at
least 5 bytes in the message. */
if (d->open && len > 4) {
- int priority = ntohl(*(int32_t*)buf);
+ int priority = ntohl(*(uint32_t*)buf);
buf += 4;
/* re-call openlog in case another instance of the port driver
* was called in the mean time */

0 comments on commit ed59619

Please sign in to comment.