]> git.sesse.net Git - cubemap/blobdiff - server.cpp
Try to fix some overflow issues on 32-bit platforms, where size_t is 32-bit. Untested.
[cubemap] / server.cpp
index be583e490d5223358d5aef68c8b826654b06e51d..ceb7f3d80b7c96db81fe4dda0d3bf0d16d15ce48 100644 (file)
@@ -1,5 +1,6 @@
 #include <assert.h>
 #include <errno.h>
+#include <inttypes.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
 #include <pthread.h>
@@ -1069,7 +1070,7 @@ void Server::construct_stream_header(Client *client)
                response.append(buf);
        } else if (client->stream_pos_end != Client::STREAM_POS_NO_END) {
                char buf[64];
-               snprintf(buf, sizeof(buf), "Content-length: %zu\r\n", client->stream_pos_end - client->stream_pos);
+               snprintf(buf, sizeof(buf), "Content-length: %" PRIu64 "\r\n", client->stream_pos_end - client->stream_pos);
                response.append(buf);
        }
        if (client->http_11) {