http-message: fix UB passing long to format string expecting int

master
rofl0r 2020-10-19 20:33:04 +01:00
parent db5c0e99b4
commit adad565c03
1 changed files with 1 additions and 1 deletions

View File

@ -259,7 +259,7 @@ int http_message_send (http_message_t msg, int fd)
write_message (fd, "Date: %s\r\n", timebuf);
/* Output the content-length */
write_message (fd, "Content-length: %u\r\n", msg->body.length);
write_message (fd, "Content-length: %lu\r\n", (unsigned long) msg->body.length);
/* Write the separator between the headers and body */
safe_write (fd, "\r\n", 2);