You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2021/11/08 18:47:30 UTC

[trafficserver] branch 9.2.x updated: Fix traffic_top build when using -Werror=format-security (#8437)

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.2.x by this push:
     new a686eb7  Fix traffic_top build when using -Werror=format-security (#8437)
a686eb7 is described below

commit a686eb73b11406fd0a8124188a8a32463d6fa3ea
Author: Jean Baptiste Favre <gi...@jbfavre.org>
AuthorDate: Wed Oct 20 20:18:51 2021 +0200

    Fix traffic_top build when using -Werror=format-security (#8437)
    
    (cherry picked from commit 66c86c6b082903a92b9db33c60e3ed947e77d540)
---
 src/traffic_top/traffic_top.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/traffic_top/traffic_top.cc b/src/traffic_top/traffic_top.cc
index d33d682..2ac6b2a 100644
--- a/src/traffic_top/traffic_top.cc
+++ b/src/traffic_top/traffic_top.cc
@@ -126,7 +126,7 @@ prettyPrint(const int x, const int y, const double number, const int type)
   }
   attron(COLOR_PAIR(color));
   attron(A_BOLD);
-  mvprintw(y, x, buffer);
+  mvprintw(y, x, "%s", buffer);
   attroff(COLOR_PAIR(color));
   attroff(A_BOLD);
 }
@@ -143,7 +143,7 @@ makeTable(const int x, const int y, const list<string> &items, Stats &stats)
     int type;
 
     stats.getStat(item, value, prettyName, type);
-    mvprintw(my_y, x, prettyName.c_str());
+    mvprintw(my_y, x, "%s", prettyName.c_str());
     prettyPrint(x + 10, my_y++, value, type);
   }
 }