[folks] tools: Use puts() instead of printf() to print a string literal
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks] tools: Use puts() instead of printf() to print a string literal
- Date: Wed, 5 Jul 2017 12:57:54 +0000 (UTC)
commit ba429bd57f2597d449cf27158cbacab5959c30ac
Author: Philip Withnall <withnall endlessm com>
Date: Wed Jul 5 13:51:53 2017 +0100
tools: Use puts() instead of printf() to print a string literal
We’ve already handled all the format placeholders in this output string,
so don’t invite output format attacks by trying to handle more of them
again.
puts() adds a trailing newline, so remove that from the string.
Signed-off-by: Philip Withnall <withnall endlessm com>
tools/inspect/utils.vala | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/tools/inspect/utils.vala b/tools/inspect/utils.vala
index eb34df3..0b842aa 100644
--- a/tools/inspect/utils.vala
+++ b/tools/inspect/utils.vala
@@ -112,8 +112,8 @@ private class Folks.Inspect.Utils
/* FIXME: store the va_list temporarily to work around bgo#638308 */
var valist = va_list ();
string output = format.vprintf (valist);
- var str = "%s%s\n".printf (Utils.indentation_string, output);
- Utils.output_filestream.printf (str);
+ var str = "%s%s".printf (Utils.indentation_string, output);
+ Utils.output_filestream.puts (str);
}
public static void print_individual (Individual individual,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]