replace magic_string.len with magic_len, fix error message and reading loop bug #29
replace magic_string.len with magic_len
Why?
Just tested this.
Remember that the follow is actually supposed to be an error for ar:
!<arch>\n
\n
\n
\n
Before this PR: zar runs into endless loop
After this PR: zar exits quietly
Actual required behavior (LLVM-ar): shows error that archive is malformed
thx for that. i will replace it with an error
Yeah, can you please change this PR to just the bug fix as requested? Please don't make unnecessary changes like replacing .len with a constant. It's unnecessary clutter.
magic_len is unnecessary but it's more regular
anyway i can drop this commit. ayush accepted that
Okay, so maybe just revert the .len changes, squash and push.
The bug fix is good, just need to recheck it (later)
ok
@ -636,0 +616,4 @@
// TODO: actually error handle not expected number of bytes being read!
_=tryreader.read(string_table_contents);
// starting_seek_pos = starting_seek_pos + first_line_buffer.len + table_size;
break;
if (chars_read == 0) {
return;
}
An archive containing only the magic is still valid, we cant error on that. This case need to be specially handled.
Everything else is fine.
I've integrated your change locall @AliChraghi and cleaned it up a tad, thank you for your contribution! It will be in soon :)
thank you. I was a little angry
Pull request closed
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?