From bdc4a04f1f78c50f11aab0cc3889a2a89fcc7dbe Mon Sep 17 00:00:00 2001 From: Jason Watkins Date: Mon, 27 Apr 2015 08:51:10 -0700 Subject: [PATCH] Fixed minor issues reported by Visual Studio code analysis tool. --- xpcPlugin/MessageHandlers.cpp | 2 +- xpcPlugin/UDPSocket.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xpcPlugin/MessageHandlers.cpp b/xpcPlugin/MessageHandlers.cpp index 04296ad..3691559 100644 --- a/xpcPlugin/MessageHandlers.cpp +++ b/xpcPlugin/MessageHandlers.cpp @@ -257,7 +257,7 @@ namespace XPC for (int i = 0; i < numCols; ++i) { unsigned char dataRef = (unsigned char)values[i][0]; - if (dataRef > 134) + if (dataRef >= 134) { #if LOG_VERBOSITY > 0 Log::FormatLine("[DATA] ERROR: DataRef # must be between 0 - 134 (Received: %hi)", (int)dataRef); diff --git a/xpcPlugin/UDPSocket.cpp b/xpcPlugin/UDPSocket.cpp index a2383e8..3b5cf3a 100644 --- a/xpcPlugin/UDPSocket.cpp +++ b/xpcPlugin/UDPSocket.cpp @@ -162,7 +162,7 @@ namespace XPC inet_ntop(AF_INET, &sin->sin_addr, ip, INET6_ADDRSTRLEN); int len = strnlen(ip, INET6_ADDRSTRLEN); ip[len++] = ':'; - sprintf(ip + len, "%d", ntohs((*sin).sin_port)); + sprintf(ip + len, "%u", ntohs((*sin).sin_port)); break; } case AF_INET6: @@ -171,7 +171,7 @@ namespace XPC inet_ntop(AF_INET6, &sin->sin6_addr, ip, INET6_ADDRSTRLEN); int len = strnlen(ip, INET6_ADDRSTRLEN); ip[len++] = ':'; - sprintf(ip + len, "%d", ntohs((*sin).sin6_port)); + sprintf(ip + len, "%u", ntohs((*sin).sin6_port)); break; } default: