From 75819200dcc0114183d490bdb9e3c7dfb6f0c842 Mon Sep 17 00:00:00 2001 From: noah Date: Mon, 9 Sep 2024 10:15:23 +0800 Subject: [PATCH] examples: fix incorrect hexadecimal representation * Update examples/sample2.rs * Update examples/sample3.rs * Update examples/sample4.rs * Update examples/sample5.rs --- examples/sample2.rs | 2 +- examples/sample3.rs | 2 +- examples/sample4.rs | 2 +- examples/sample5.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/sample2.rs b/examples/sample2.rs index b754d81..5336d51 100644 --- a/examples/sample2.rs +++ b/examples/sample2.rs @@ -166,7 +166,7 @@ impl BytePacketBuffer { fn write_qname(&mut self, qname: &str) -> Result<()> { for label in qname.split('.') { let len = label.len(); - if len > 0x34 { + if len > 0x3f { return Err("Single label exceeds 63 characters of length".into()); } diff --git a/examples/sample3.rs b/examples/sample3.rs index 32a3001..203cb2d 100644 --- a/examples/sample3.rs +++ b/examples/sample3.rs @@ -166,7 +166,7 @@ impl BytePacketBuffer { fn write_qname(&mut self, qname: &str) -> Result<()> { for label in qname.split('.') { let len = label.len(); - if len > 0x34 { + if len > 0x3f { return Err("Single label exceeds 63 characters of length".into()); } diff --git a/examples/sample4.rs b/examples/sample4.rs index a648131..a1633ad 100644 --- a/examples/sample4.rs +++ b/examples/sample4.rs @@ -166,7 +166,7 @@ impl BytePacketBuffer { fn write_qname(&mut self, qname: &str) -> Result<()> { for label in qname.split('.') { let len = label.len(); - if len > 0x34 { + if len > 0x3f { return Err("Single label exceeds 63 characters of length".into()); } diff --git a/examples/sample5.rs b/examples/sample5.rs index 40555c9..c2b47df 100644 --- a/examples/sample5.rs +++ b/examples/sample5.rs @@ -166,7 +166,7 @@ impl BytePacketBuffer { fn write_qname(&mut self, qname: &str) -> Result<()> { for label in qname.split('.') { let len = label.len(); - if len > 0x34 { + if len > 0x3f { return Err("Single label exceeds 63 characters of length".into()); }