diff --git a/src/interpreter.cc b/src/interpreter.cc
index f80dbb1efeefc6eb802f29d74620658b59d4736e..97fcbe00931dd59748b81195ba37bbb88f794050 100644
--- a/src/interpreter.cc
+++ b/src/interpreter.cc
@@ -247,9 +247,9 @@ void Interpreter::runMain(void) {
 
 std::string Interpreter::processStream(std::istream& stream, std::ostream& os) {
   char line[10000];
-  sprintf(line, "%s", "\n");
-  std::string command;
   std::streamsize maxSize = 10000;
+  snprintf(line, static_cast<size_t>(maxSize), "%s", "\n");
+  std::string command;
 #if 0
   while (line != std::string("")) {
     stream.getline(line, maxSize, '\n');