mirror of
https://codeberg.org/icewind/tf-log-parser.git
synced 2026-11-30 04:40:47 +01:00
better truncation handling
This commit is contained in:
parent
1b9addbb4f
commit
9a11408237
2 changed files with 14 additions and 10 deletions
|
|
@ -24,6 +24,9 @@ impl<'a> RawEvent<'a> {
|
|||
}
|
||||
|
||||
fn event_parser(input: &str) -> Result<RawEvent> {
|
||||
if input.len() < 30 {
|
||||
return Err(Error::Truncated);
|
||||
}
|
||||
let date = RawDate(&input[0..21]);
|
||||
|
||||
let (input, subject) = subject_parser(&input[23..])?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue