*/
#include "headers.h"
-#include "SDL_mutex.h"
+#include <SDL/SDL_mutex.h>
MedalServer::MedalServer()
{
debug(("Connected %s to %s:%d\n", privateKey, MEDAL_SERVER_HOST, MEDAL_SERVER_PORT));
- strncpy(this->privateKey, privateKey, sizeof this->privateKey);
+ strlcpy(this->privateKey, privateKey, sizeof this->privateKey);
connected = true;
return true;
char *store;
char medal[128];
- strncpy(medal, str, sizeof medal);
+ strlcpy(medal, str, sizeof medal);
for (unsigned int i = 0 ; i < strlen(medal) ; i++)
{
return 0;
}
- char *in = new char[1024];
char out[1024];
snprintf(out, sizeof out, "GET /addMedal/%s/MBS_%s HTTP/1.1\nHost: %s\nUser-Agent:BWMBS%.2f-%d\n\n", privateKey, medal, MEDAL_SERVER_HOST, VERSION, RELEASE);
return 0;
}
+ char *in = new char[1024];
+
SDLNet_TCP_Recv(socket, in, 512);
//printf("%s\n", in);
if (response == 4)
{
- strncpy(rubyMessage, message, sizeof rubyMessage);
+ strlcpy(rubyMessage, message, sizeof rubyMessage);
gotRuby = true;
}
else
debug(("MedalServer Response: %d '%s'\n", response, message))
- delete in;
+ delete[] in;
SDLNet_TCP_Close(socket);