diff --git a/src/SpeedtestConfig.c b/SpeedTestC/src/SpeedtestConfig.c index 7b60a59..d9f58c9 100644 --- a/src/SpeedtestConfig.c +++ b/src/SpeedtestConfig.c @@ -50,7 +50,7 @@ static void parseClient(const char *configline, SPEEDTESTCONFIG_T **result_p) char lat[16] = {0}; char lon[16] = {0}; - if(sscanf(configline,"%*[^\"]\"%15[^\"]\"%*[^\"]\"%15[^\"]\"%*[^\"]\"%15[^\"]\"%*[^\"]\"%255[^\"]\"", + if(sscanf(configline,"%*[^\"]\"%15[^\"]\"%*[^\"]\"%20[^\"]\"%*[^\"]\"%20[^\"]\"%*[^\"]\"%255[^\"]\"", result->ip, lat, lon, result->isp)!=4) { fprintf(stderr,"Cannot parse all fields! Config line: %s", configline); diff --git a/src/SpeedtestDownloadTest.c b/src/SpeedtestDownloadTest.c index 54ed45d..545582a 100644 --- a/src/SpeedtestDownloadTest.c +++ b/src/SpeedtestDownloadTest.c @@ -32,7 +32,7 @@ static void *__downloadThread(void *arg) return NULL; } -void testDownload(const char *url) +void testDownload(char *url) { size_t numOfThreads = speedTestConfig->downloadThreadConfig.count * speedTestConfig->downloadThreadConfig.sizeLength; diff --git a/src/SpeedtestDownloadTest.h b/src/SpeedtestDownloadTest.h index e341f31..45e9d9a 100644 --- a/src/SpeedtestDownloadTest.h +++ b/src/SpeedtestDownloadTest.h @@ -1,6 +1,6 @@ #ifndef _SPEEDTEST_DOWNLOAD_TEST_ #define _SPEEDTEST_DOWNLOAD_TEST_ -void testDownload(const char *url); +void testDownload(char *url); #endif diff --git a/src/SpeedtestServers.c b/src/SpeedtestServers.c index 5456f69..e3ca9b4 100644 --- a/src/SpeedtestServers.c +++ b/src/SpeedtestServers.c @@ -106,9 +106,9 @@ SPEEDTESTSERVER_T **getServers(int *serverCount, char *ignoreServers, float lat, "http://c.speedtest.net/speedtest-servers-static.php", "http://www.speedtest.net/speedtest-servers.php", "http://c.speedtest.net/speedtest-servers.php"}; - const u_int32_t urlsCount = 4; - u_int32_t count = 0; - u_int32_t reallocCount = 0; + const __int32_t urlsCount = 4; + __int32_t count = 0; + __int32_t reallocCount = 0; /* malloc the size as the macro SERVER_SIZE defines */ list = (SPEEDTESTSERVER_T**)calloc(SERVER_SIZE, sizeof(SPEEDTESTSERVER_T**)); diff --git a/src/SpeedtestUploadTest.c b/src/SpeedtestUploadTest.c index b0414df..5804af6 100644 --- a/src/SpeedtestUploadTest.c +++ b/src/SpeedtestUploadTest.c @@ -24,7 +24,7 @@ static void *__uploadThread(void *arg) { /* Testing upload... */ THREADARGS_T *threadConfig = (THREADARGS_T *)arg; - int i, size, sockId; + int size, sockId; unsigned long totalTransfered = 0; char uploadUrl[1024]; diff --git a/src/http.c b/src/http.c index 7ace0e1..4c03205 100644 --- a/src/http.c +++ b/src/http.c @@ -112,7 +112,7 @@ int httpGet(char* pAddress, int pPort, char* pRequest) } - if(!success == 1) + if((!success) == 1) { close(sockId); return 0;