From a94a150df079273d6d03d765cf5ae0822e2d0aa8 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 25 Mar 2020 14:08:47 +0100 Subject: [PATCH] LibJS: Remove unnecessary space character at the end of console.log() --- Libraries/LibJS/Runtime/ConsoleObject.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Libraries/LibJS/Runtime/ConsoleObject.cpp b/Libraries/LibJS/Runtime/ConsoleObject.cpp index c5e307a982..f3ed7cc01d 100644 --- a/Libraries/LibJS/Runtime/ConsoleObject.cpp +++ b/Libraries/LibJS/Runtime/ConsoleObject.cpp @@ -34,9 +34,12 @@ namespace JS { ConsoleObject::ConsoleObject() { put_native_function("log", [](Object*, const Vector& arguments) -> Value { - for (auto& argument : arguments) - printf("%s ", argument.to_string().characters()); - printf("\n"); + for (size_t i = 0; i < arguments.size(); ++i) { + printf("%s", arguments[i].to_string().characters()); + if (i != arguments.size() - 1) + putchar(' '); + } + putchar('\n'); return js_undefined(); }); }