openbsd-ports/games/numptyphysics/patches/patch-happyhttp_cpp
sthen b977e4e00b Various patches to improve the game engine and allow all the npcomplete
levels to work. Some from Erik Hovland via the numptyphysics bug tracker,
some from David Coppa. Port diff from David Coppa (maintainer).
2009-10-22 23:07:54 +00:00

44 lines
1.1 KiB
Plaintext

$OpenBSD: patch-happyhttp_cpp,v 1.2 2009/10/22 23:07:54 sthen Exp $
--- happyhttp.cpp.orig Thu Aug 28 12:08:27 2008
+++ happyhttp.cpp Thu Oct 15 17:41:39 2009
@@ -28,12 +28,12 @@
#include "happyhttp.h"
#ifndef WIN32
+ #include <cerrno>
// #include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h> // for gethostbyname()
- #include <errno.h>
#endif
#ifdef WIN32
@@ -48,7 +48,6 @@
#include <string>
#include <vector>
-#include <string>
#include <algorithm>
@@ -357,7 +356,7 @@ void Connection::putrequest( const char* method, const
m_State = REQ_STARTED;
char req[ 512 ];
- sprintf( req, "%s %s HTTP/1.1", method, url );
+ snprintf( req, 512, "%s %s HTTP/1.1", method, url );
m_Buffer.push_back( req );
putheader( "Host", m_Host.c_str() ); // required for HTTP1.1
@@ -381,7 +380,7 @@ void Connection::putheader( const char* header, const
void Connection::putheader( const char* header, int numericvalue )
{
char buf[32];
- sprintf( buf, "%d", numericvalue );
+ snprintf( buf, 32, "%d", numericvalue );
putheader( header, buf );
}