diff --git a/reactos/base/services/dhcp/dhclient.c b/reactos/base/services/dhcp/dhclient.c index b13504f80b1..660fdfa49db 100644 --- a/reactos/base/services/dhcp/dhclient.c +++ b/reactos/base/services/dhcp/dhclient.c @@ -2044,7 +2044,7 @@ option_as_string(unsigned int code, unsigned char *data, int len) for (; dp < data + len; dp++) { if (!isascii(*dp) || !isprint(*dp)) { if (dp + 1 != data + len || *dp != 0) { - snprintf(op, opleft, "\\%03o", *dp); + _snprintf(op, opleft, "\\%03o", *dp); op += 4; opleft -= 4; } diff --git a/reactos/base/services/dhcp/dhcp.rbuild b/reactos/base/services/dhcp/dhcp.rbuild index fdbdf9f609e..6d47e246994 100644 --- a/reactos/base/services/dhcp/dhcp.rbuild +++ b/reactos/base/services/dhcp/dhcp.rbuild @@ -1,4 +1,4 @@ - + . include diff --git a/reactos/base/services/dhcp/include/rosdhcp.h b/reactos/base/services/dhcp/include/rosdhcp.h index 9141953f7ae..dbcbc127be4 100644 --- a/reactos/base/services/dhcp/include/rosdhcp.h +++ b/reactos/base/services/dhcp/include/rosdhcp.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "stdint.h" #include "predec.h" diff --git a/reactos/base/services/dhcp/options.c b/reactos/base/services/dhcp/options.c index 46bc453840e..4c594b1fe7e 100644 --- a/reactos/base/services/dhcp/options.c +++ b/reactos/base/services/dhcp/options.c @@ -566,7 +566,7 @@ pretty_print_option(unsigned int code, unsigned char *data, int len, !isprint(*dp)) { if (dp + 1 != data + len || *dp != 0) { - snprintf(op, opleft, + _snprintf(op, opleft, "\\%03o", *dp); op += 4; opleft -= 4; @@ -602,7 +602,7 @@ pretty_print_option(unsigned int code, unsigned char *data, int len, dp += 4; break; case 'l': - opcount = snprintf(op, opleft, "%ld", + opcount = _snprintf(op, opleft, "%ld", (long)getLong(dp)); if (opcount >= opleft || opcount == -1) goto toobig; @@ -610,7 +610,7 @@ pretty_print_option(unsigned int code, unsigned char *data, int len, dp += 4; break; case 'L': - opcount = snprintf(op, opleft, "%ld", + opcount = _snprintf(op, opleft, "%ld", (unsigned long)getULong(dp)); if (opcount >= opleft || opcount == -1) goto toobig; @@ -618,7 +618,7 @@ pretty_print_option(unsigned int code, unsigned char *data, int len, dp += 4; break; case 's': - opcount = snprintf(op, opleft, "%d", + opcount = _snprintf(op, opleft, "%d", getShort(dp)); if (opcount >= opleft || opcount == -1) goto toobig; @@ -626,7 +626,7 @@ pretty_print_option(unsigned int code, unsigned char *data, int len, dp += 2; break; case 'S': - opcount = snprintf(op, opleft, "%d", + opcount = _snprintf(op, opleft, "%d", getUShort(dp)); if (opcount >= opleft || opcount == -1) goto toobig; @@ -634,20 +634,20 @@ pretty_print_option(unsigned int code, unsigned char *data, int len, dp += 2; break; case 'b': - opcount = snprintf(op, opleft, "%d", + opcount = _snprintf(op, opleft, "%d", *(char *)dp++); if (opcount >= opleft || opcount == -1) goto toobig; opleft -= opcount; break; case 'B': - opcount = snprintf(op, opleft, "%d", *dp++); + opcount = _snprintf(op, opleft, "%d", *dp++); if (opcount >= opleft || opcount == -1) goto toobig; opleft -= opcount; break; case 'x': - opcount = snprintf(op, opleft, "%x", *dp++); + opcount = _snprintf(op, opleft, "%x", *dp++); if (opcount >= opleft || opcount == -1) goto toobig; opleft -= opcount; diff --git a/reactos/base/services/dhcp/util.c b/reactos/base/services/dhcp/util.c index 8e66ba4f49b..7c4c6b37729 100644 --- a/reactos/base/services/dhcp/util.c +++ b/reactos/base/services/dhcp/util.c @@ -100,6 +100,7 @@ int read_client_conf(void) { /* What a strage dance */ struct client_config *config; char ComputerName [MAX_COMPUTERNAME_LENGTH + 1]; + LPSTR lpCompName; DWORD ComputerNameSize = sizeof ComputerName / sizeof ComputerName[0]; if ((ifi!= NULL) && (ifi->client->config != NULL)) @@ -113,12 +114,12 @@ int read_client_conf(void) { GetComputerName(ComputerName, & ComputerNameSize); /* This never gets freed since it's only called once */ - LPSTR lpCompName = + lpCompName = HeapAlloc(GetProcessHeap(), 0, strlen(ComputerName) + 1); if (lpCompName !=NULL) { GetComputerName(lpCompName, & ComputerNameSize); /* Send our hostname, some dhcpds use this to update DNS */ - config->send_options[DHO_HOST_NAME].data = strlwr(lpCompName); + config->send_options[DHO_HOST_NAME].data = (u_int8_t*)strlwr(lpCompName); config->send_options[DHO_HOST_NAME].len = strlen(ComputerName); debug("Hostname: %s, length: %d", config->send_options[DHO_HOST_NAME].data,