From fe62ed9844b99ec30f4f05809e5abb59f3dfb181 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Wed, 22 May 2013 13:38:09 -0700 Subject: [PATCH] fix CS issues --- voxel-server/src/main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/voxel-server/src/main.cpp b/voxel-server/src/main.cpp index 92494c37d0..ae1f01edec 100644 --- a/voxel-server/src/main.cpp +++ b/voxel-server/src/main.cpp @@ -624,24 +624,24 @@ int main(int argc, const char * argv[]) { // requests, like erase all, or add sphere scene char* command = (char*) &packetData[1]; // start of the command int commandLength = strlen(command); // commands are null terminated strings - int totalLength = 1+commandLength+1; + int totalLength = sizeof(PACKET_HEADER_Z_COMMAND) + commandLength + 1; // 1 for null termination - printf("got Z message len(%ld)= %s\n",receivedBytes,command); + printf("got Z message len(%ld)= %s\n", receivedBytes, command); while (totalLength <= receivedBytes) { - if (strcmp(command,(char*)"erase all") == 0) { + if (strcmp(command, (char*)"erase all") == 0) { printf("got Z message == erase all\n"); eraseVoxelTreeAndCleanupAgentVisitData(); } - if (strcmp(command,(char*)"add scene") == 0) { + if (strcmp(command, (char*)"add scene") == 0) { printf("got Z message == add scene\n"); addSphereScene(&randomTree); } - if (strcmp(command,(char*)"a message") == 0) { + if (strcmp(command, (char*)"a message") == 0) { printf("got Z message == a message, nothing to do, just report\n"); } - totalLength += commandLength+1; + totalLength += commandLength + 1; // 1 for null termination } // Now send this to the connected agents so they can also process these messages