[Git][NTPsec/ntpsec][master] Fixed division by zero error in ntpmon
Eric S. Raymond
gitlab at mg.gitlab.com
Tue May 2 19:42:22 UTC 2017
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
8acbb223 by Ian Bruene at 2017-05-02T14:25:14-05:00
Fixed division by zero error in ntpmon
Previously using the arrow or j/k keys when peers hidden resulted in an error,
now that input will only be accepted if peers are visible.
- - - - -
1 changed file:
- ntpclients/ntpmon
Changes:
=====================================
ntpclients/ntpmon
=====================================
--- a/ntpclients/ntpmon
+++ b/ntpclients/ntpmon
@@ -366,11 +366,13 @@ if __name__ == '__main__':
else:
peer_report.displaymode = 'peers'
elif key == 'j' or key == "KEY_DOWN":
- selected += 1
- selected %= len(peers)
+ if showpeers:
+ selected += 1
+ selected %= len(peers)
elif key == 'k' or key == "KEY_UP":
- selected += len(peers) - 1
- selected %= len(peers)
+ if showpeers:
+ selected += len(peers) - 1
+ selected %= len(peers)
elif key == '+':
if session.debug == 0:
session.logfp = open("ntpmon.log", "a", 1)
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/8acbb223a699434418aaea2b2d6082fe23d8fb5f
---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/8acbb223a699434418aaea2b2d6082fe23d8fb5f
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170502/7df1137f/attachment.html>
More information about the vc
mailing list