aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ntp.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2010-05-20 11:56:58 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2010-05-20 11:56:58 +0000
commitf945be91f695d5c42f11982bef473c0f75e985f3 (patch)
tree6ede8ce54ece503e9585fcf46658f0c6b12e853d /epan/dissectors/packet-ntp.c
parent7773d1a2a689e3d232849dbe37d7628f37cd618f (diff)
Rewrote to avoid "More data arguments than '%' conversions" warning.
svn path=/trunk/; revision=32908
Diffstat (limited to 'epan/dissectors/packet-ntp.c')
-rw-r--r--epan/dissectors/packet-ntp.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/epan/dissectors/packet-ntp.c b/epan/dissectors/packet-ntp.c
index 9afa49576e..3d3cfce649 100644
--- a/epan/dissectors/packet-ntp.c
+++ b/epan/dissectors/packet-ntp.c
@@ -696,14 +696,19 @@ dissect_ntp_std(tvbuff_t *tvb, proto_tree *ntp_tree, guint8 flags)
* power of two.
*/
ppoll = tvb_get_guint8(tvb, 2);
- proto_tree_add_uint_format(ntp_tree, hf_ntp_ppoll, tvb, 2, 1,
- ppoll,
- (((ppoll >= 4) && (ppoll <= 17)) ?
- "Peer Polling Interval: %u (%u sec)" :
- "Peer Polling Interval: invalid (%u)"),
+ if ((ppoll >= 4) && (ppoll <= 17)) {
+ proto_tree_add_uint_format(ntp_tree, hf_ntp_ppoll, tvb, 2, 1,
+ ppoll,
+ "Peer Polling Interval: %u (%u sec)",
ppoll,
1 << ppoll);
-
+ } else {
+ proto_tree_add_uint_format(ntp_tree, hf_ntp_ppoll, tvb, 2, 1,
+ ppoll,
+ "Peer Polling Interval: invalid (%u)",
+ ppoll);
+ }
+
/* Precision, 1byte field indicating the precision of the
* local clock, in seconds to the nearest power of two.
*/