Skip to content

Commit

Permalink
Improve Windows support.
Browse files Browse the repository at this point in the history
  • Loading branch information
tuexen committed May 3, 2016
1 parent 5b00176 commit 60d8251
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions programs/http_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
* Usage: http_client remote_addr remote_port [local_port] [local_encaps_port] [remote_encaps_port] [uri]
*/

#ifdef _WIN32
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -145,9 +148,17 @@ main(int argc, char *argv[])
}

if (argc > 6) {
#ifdef _WIN32
_snprintf(request, sizeof(request), "%s %s %s", request_prefix, argv[6], request_postfix);
#else
snprintf(request, sizeof(request), "%s %s %s", request_prefix, argv[6], request_postfix);
#endif
} else {
#ifdef _WIN32
_snprintf(request, sizeof(request), "%s %s %s", request_prefix, "/", request_postfix);
#else
snprintf(request, sizeof(request), "%s %s %s", request_prefix, "/", request_postfix);
#endif
}

printf("\nHTTP request:\n%s\n", request);
Expand Down

0 comments on commit 60d8251

Please sign in to comment.