examples: fix incorrect hexadecimal representation

* Update examples/sample2.rs
* Update examples/sample3.rs
* Update examples/sample4.rs
* Update examples/sample5.rs
This commit is contained in:
noah 2024-09-09 10:15:23 +08:00
parent 855a381d2d
commit 75819200dc
4 changed files with 4 additions and 4 deletions

View File

@ -166,7 +166,7 @@ impl BytePacketBuffer {
fn write_qname(&mut self, qname: &str) -> Result<()> { fn write_qname(&mut self, qname: &str) -> Result<()> {
for label in qname.split('.') { for label in qname.split('.') {
let len = label.len(); let len = label.len();
if len > 0x34 { if len > 0x3f {
return Err("Single label exceeds 63 characters of length".into()); return Err("Single label exceeds 63 characters of length".into());
} }

View File

@ -166,7 +166,7 @@ impl BytePacketBuffer {
fn write_qname(&mut self, qname: &str) -> Result<()> { fn write_qname(&mut self, qname: &str) -> Result<()> {
for label in qname.split('.') { for label in qname.split('.') {
let len = label.len(); let len = label.len();
if len > 0x34 { if len > 0x3f {
return Err("Single label exceeds 63 characters of length".into()); return Err("Single label exceeds 63 characters of length".into());
} }

View File

@ -166,7 +166,7 @@ impl BytePacketBuffer {
fn write_qname(&mut self, qname: &str) -> Result<()> { fn write_qname(&mut self, qname: &str) -> Result<()> {
for label in qname.split('.') { for label in qname.split('.') {
let len = label.len(); let len = label.len();
if len > 0x34 { if len > 0x3f {
return Err("Single label exceeds 63 characters of length".into()); return Err("Single label exceeds 63 characters of length".into());
} }

View File

@ -166,7 +166,7 @@ impl BytePacketBuffer {
fn write_qname(&mut self, qname: &str) -> Result<()> { fn write_qname(&mut self, qname: &str) -> Result<()> {
for label in qname.split('.') { for label in qname.split('.') {
let len = label.len(); let len = label.len();
if len > 0x34 { if len > 0x3f {
return Err("Single label exceeds 63 characters of length".into()); return Err("Single label exceeds 63 characters of length".into());
} }