cpp: Eliminate a buffer overflow in the tutorial server

Negative numbers can have 11 characters :)


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@758529 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/tutorial/cpp/CppServer.cpp b/tutorial/cpp/CppServer.cpp
index a2c30d2..044e1d9 100644
--- a/tutorial/cpp/CppServer.cpp
+++ b/tutorial/cpp/CppServer.cpp
@@ -69,8 +69,8 @@
 
     SharedStruct ss;
     ss.key = logid;
-    char buffer[11];
-    sprintf(buffer, "%d", val);
+    char buffer[12];
+    snprintf(buffer, sizeof(buffer), "%d", val);
     ss.value = buffer;
 
     log[logid] = ss;