Fixed minor issues reported by Visual Studio code analysis tool.

This commit is contained in:
Jason Watkins
2015-04-27 08:51:10 -07:00
parent 31609f904f
commit bdc4a04f1f
2 changed files with 3 additions and 3 deletions

View File

@@ -257,7 +257,7 @@ namespace XPC
for (int i = 0; i < numCols; ++i) for (int i = 0; i < numCols; ++i)
{ {
unsigned char dataRef = (unsigned char)values[i][0]; unsigned char dataRef = (unsigned char)values[i][0];
if (dataRef > 134) if (dataRef >= 134)
{ {
#if LOG_VERBOSITY > 0 #if LOG_VERBOSITY > 0
Log::FormatLine("[DATA] ERROR: DataRef # must be between 0 - 134 (Received: %hi)", (int)dataRef); Log::FormatLine("[DATA] ERROR: DataRef # must be between 0 - 134 (Received: %hi)", (int)dataRef);

View File

@@ -162,7 +162,7 @@ namespace XPC
inet_ntop(AF_INET, &sin->sin_addr, ip, INET6_ADDRSTRLEN); inet_ntop(AF_INET, &sin->sin_addr, ip, INET6_ADDRSTRLEN);
int len = strnlen(ip, INET6_ADDRSTRLEN); int len = strnlen(ip, INET6_ADDRSTRLEN);
ip[len++] = ':'; ip[len++] = ':';
sprintf(ip + len, "%d", ntohs((*sin).sin_port)); sprintf(ip + len, "%u", ntohs((*sin).sin_port));
break; break;
} }
case AF_INET6: case AF_INET6:
@@ -171,7 +171,7 @@ namespace XPC
inet_ntop(AF_INET6, &sin->sin6_addr, ip, INET6_ADDRSTRLEN); inet_ntop(AF_INET6, &sin->sin6_addr, ip, INET6_ADDRSTRLEN);
int len = strnlen(ip, INET6_ADDRSTRLEN); int len = strnlen(ip, INET6_ADDRSTRLEN);
ip[len++] = ':'; ip[len++] = ':';
sprintf(ip + len, "%d", ntohs((*sin).sin6_port)); sprintf(ip + len, "%u", ntohs((*sin).sin6_port));
break; break;
} }
default: default: