From a01de984340cf654449d462f3ad06ac9ba0b909b Mon Sep 17 00:00:00 2001 From: "Brian Fraser fraserb@gmail.com" <> Date: Tue, 3 Apr 2012 12:50:12 -0300 Subject: [PATCH] Fix for a bug in 32-bit Debian. Namely, awk's printf("%d") doing what it's supposed to do, cast it's operand to (int), which screws up large numbers. The fix is simple, although it mostly just pushes the problem under the rug; using %.0f instead of %d. --- bin/pt-summary | 2 +- lib/bash/report_system_info.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/pt-summary b/bin/pt-summary index abe1fce4..8b03fe66 100755 --- a/bin/pt-summary +++ b/bin/pt-summary @@ -1439,7 +1439,7 @@ parse_ip_s_link () { local PTFUNCNAME=parse_ip_s_link; fuzzy_var = \$1; ${fuzzy_formula} tx_bytes = fuzzy_var; fuzzy_var = \$2; ${fuzzy_formula} tx_packets = fuzzy_var; fuzzy_var = \$3; ${fuzzy_formula} tx_errors = fuzzy_var; - printf \" %-8s %10d %10d %10d %10d %10d %10d\\n\", save[\"iface\"], save[\"bytes\"], save[\"packs\"], save[\"errs\"], tx_bytes, tx_packets, tx_errors; + printf \" %-8s %10.0f %10.0f %10.0f %10.0f %10.0f %10.0f\\n\", save[\"iface\"], save[\"bytes\"], save[\"packs\"], save[\"errs\"], tx_bytes, tx_packets, tx_errors; } }" "$file" } diff --git a/lib/bash/report_system_info.sh b/lib/bash/report_system_info.sh index 384d859c..f18613aa 100644 --- a/lib/bash/report_system_info.sh +++ b/lib/bash/report_system_info.sh @@ -262,7 +262,7 @@ parse_ip_s_link () { local PTFUNCNAME=parse_ip_s_link; fuzzy_var = \$1; ${fuzzy_formula} tx_bytes = fuzzy_var; fuzzy_var = \$2; ${fuzzy_formula} tx_packets = fuzzy_var; fuzzy_var = \$3; ${fuzzy_formula} tx_errors = fuzzy_var; - printf \" %-8s %10d %10d %10d %10d %10d %10d\\n\", save[\"iface\"], save[\"bytes\"], save[\"packs\"], save[\"errs\"], tx_bytes, tx_packets, tx_errors; + printf \" %-8s %10.0f %10.0f %10.0f %10.0f %10.0f %10.0f\\n\", save[\"iface\"], save[\"bytes\"], save[\"packs\"], save[\"errs\"], tx_bytes, tx_packets, tx_errors; } }" "$file" }