Skip to content

Commit

Permalink
Fix parsing of stratum 1 identifiers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Greer committed Jun 4, 2020
1 parent d5e4f8d commit ec495e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/net/ntp/ntp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def bin2frac(bin) #:nodoc:

def unpack_ip(stratum, tmp_ip) #:nodoc:
if stratum < 2
[tmp_ip].pack("H8").unpack("A4").bytes.first
[tmp_ip].pack("H8").unpack("A4").first
else
ipbytes = [tmp_ip].pack("H8").unpack("C4")
sprintf("%d.%d.%d.%d", ipbytes[0], ipbytes[1], ipbytes[2], ipbytes[3])
Expand Down

0 comments on commit ec495e0

Please sign in to comment.