mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Put warning about possibly wrong password at appropriate place in stream.c
Use char to be consistent in open_stream_in. Fail to failure() instead of fatal() should open_stream_in fail.
This commit is contained in:
parent
64bba65c11
commit
f7a1c14e28
2
runzip.c
2
runzip.c
|
|
@ -303,7 +303,7 @@ static i64 runzip_chunk(rzip_control *control, int fd_in, int fd_out, int fd_his
|
||||||
|
|
||||||
ss = open_stream_in(control, fd_in, NUM_STREAMS, chunk_bytes);
|
ss = open_stream_in(control, fd_in, NUM_STREAMS, chunk_bytes);
|
||||||
if (unlikely(!ss))
|
if (unlikely(!ss))
|
||||||
fatal("Failed to open_stream_in in runzip_chunk\n");
|
failure("Failed to open_stream_in in runzip_chunk\n");
|
||||||
|
|
||||||
while ((len = read_header(control, ss, &head)) || head) {
|
while ((len = read_header(control, ss, &head)) || head) {
|
||||||
switch (head) {
|
switch (head) {
|
||||||
|
|
|
||||||
6
stream.c
6
stream.c
|
|
@ -584,7 +584,7 @@ static int lzma_decompress_buf(rzip_control *control, struct uncomp_thread *ucth
|
||||||
c_buf = ucthread->s_buf;
|
c_buf = ucthread->s_buf;
|
||||||
ucthread->s_buf = malloc(dlen);
|
ucthread->s_buf = malloc(dlen);
|
||||||
if (unlikely(!ucthread->s_buf)) {
|
if (unlikely(!ucthread->s_buf)) {
|
||||||
print_err("Failed to allocate %lldd bytes for decompression\n", (i64)dlen);
|
print_err("Failed to allocate %lld bytes for decompression\n", (i64)dlen);
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
@ -1072,7 +1072,7 @@ static void decrypt_header(rzip_control *control, uchar *head, uchar *c_type,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* prepare a set of n streams for reading on file descriptor f */
|
/* prepare a set of n streams for reading on file descriptor f */
|
||||||
void *open_stream_in(rzip_control *control, int f, int n, int chunk_bytes)
|
void *open_stream_in(rzip_control *control, int f, int n, char chunk_bytes)
|
||||||
{
|
{
|
||||||
struct stream_info *sinfo;
|
struct stream_info *sinfo;
|
||||||
int total_threads, i;
|
int total_threads, i;
|
||||||
|
|
@ -1190,6 +1190,8 @@ again:
|
||||||
|
|
||||||
if (unlikely(c != CTYPE_NONE)) {
|
if (unlikely(c != CTYPE_NONE)) {
|
||||||
print_err("Unexpected initial tag %d in streams\n", c);
|
print_err("Unexpected initial tag %d in streams\n", c);
|
||||||
|
if (ENCRYPT)
|
||||||
|
print_err("Wrong password?\n");
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
if (unlikely(v1)) {
|
if (unlikely(v1)) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue