Browse Source

make sure packet len is divisible by 4

pull/3/head
Jake Probst 5 years ago
parent
commit
17cf4bb056
  1. 4
      psopacket/src/lib.rs

4
psopacket/src/lib.rs

@ -234,6 +234,10 @@ pub fn pso_packet(attr: TokenStream, item: TokenStream) -> TokenStream {
let mut buf: Vec<u8> = Vec::new(); let mut buf: Vec<u8> = Vec::new();
#(#as_bytes)* #(#as_bytes)*
while buf.len() % 4 != 0 {
buf.push(0);
}
let pkt_len = (buf.len() + 4) as u16; let pkt_len = (buf.len() + 4) as u16;
let mut prebuf: Vec<u8> = Vec::new(); let mut prebuf: Vec<u8> = Vec::new();

Loading…
Cancel
Save