summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjosh.macdonald <jmacd@users.noreply.github.com>2012-06-18 15:44:02 +0000
committerjosh.macdonald <jmacd@users.noreply.github.com>2012-06-18 15:44:02 +0000
commit682e6c256ce25420951faf89ec104abb856deea8 (patch)
treed2eb39b0c0ba74fd6eff72e043216d91351512c7
parentf1d09a6659bf905e0c417b95383902e7dc52ccc4 (diff)
Adds an error message for XD3_INVALID_INPUT
-rw-r--r--xdelta3/xdelta3-decode.h16
-rw-r--r--xdelta3/xdelta3-main.h5
2 files changed, 12 insertions, 9 deletions
diff --git a/xdelta3/xdelta3-decode.h b/xdelta3/xdelta3-decode.h
index 685a7ff..d33a79e 100644
--- a/xdelta3/xdelta3-decode.h
+++ b/xdelta3/xdelta3-decode.h
@@ -453,13 +453,13 @@ xd3_decode_output_halfinst (xd3_stream *stream, xd3_hinst *inst)
453 if ((source->onblk != blksize) && 453 if ((source->onblk != blksize) &&
454 (blkoff + take > source->onblk)) 454 (blkoff + take > source->onblk))
455 { 455 {
456 XPR(NT "[srcfile] short at blkno %"Q"u onblk " 456 IF_DEBUG1 (XPR(NT "[srcfile] short at blkno %"Q"u onblk "
457 "%u blksize %u blkoff %u take %u\n", 457 "%u blksize %u blkoff %u take %u\n",
458 block, 458 block,
459 source->onblk, 459 source->onblk,
460 blksize, 460 blksize,
461 blkoff, 461 blkoff,
462 take); 462 take));
463 stream->msg = "source file too short"; 463 stream->msg = "source file too short";
464 return XD3_INVALID_INPUT; 464 return XD3_INVALID_INPUT;
465 } 465 }
@@ -505,8 +505,6 @@ xd3_decode_output_halfinst (xd3_stream *stream, xd3_hinst *inst)
505 505
506 stream->avail_out += take; 506 stream->avail_out += take;
507 507
508 //XPR(NT "memcpy here with take=%u\n", take);
509
510 if (overlap) 508 if (overlap)
511 { 509 {
512 /* Can't just memcpy here due to possible overlap. */ 510 /* Can't just memcpy here due to possible overlap. */
diff --git a/xdelta3/xdelta3-main.h b/xdelta3/xdelta3-main.h
index 32295d4..986165b 100644
--- a/xdelta3/xdelta3-main.h
+++ b/xdelta3/xdelta3-main.h
@@ -3316,6 +3316,11 @@ main_input (xd3_cmd cmd,
3316 default: 3316 default:
3317 /* input_func() error */ 3317 /* input_func() error */
3318 XPR(NT XD3_LIB_ERRMSG (& stream, ret)); 3318 XPR(NT XD3_LIB_ERRMSG (& stream, ret));
3319 if (! option_quiet && ret == XD3_INVALID_INPUT)
3320 {
3321 XPR(NT "normally this indicates that the source file is incorrect\n");
3322 XPR(NT "please verify the source file with sha1sum or equivalent\n");
3323 }
3319 return EXIT_FAILURE; 3324 return EXIT_FAILURE;
3320 } 3325 }
3321 } 3326 }