Skip to content

Commit

Permalink
Revert "diff-delta.c: allow delta with empty blob."
Browse files Browse the repository at this point in the history
This reverts 962537a commit to
play safe.
  • Loading branch information
Junio C Hamano committed Dec 13, 2005
1 parent 44db136 commit c7a45bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions delta.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ extern void *patch_delta(void *src_buf, unsigned long src_size,
void *delta_buf, unsigned long delta_size,
unsigned long *dst_size);

/* the smallest possible delta size is 2 bytes (empty to empty) */
#define DELTA_SIZE_MIN 2
/* the smallest possible delta size is 4 bytes */
#define DELTA_SIZE_MIN 4

/*
* This must be called twice on the delta data buffer, first to get the
Expand Down
2 changes: 1 addition & 1 deletion diff-delta.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void *diff_delta(void *from_buf, unsigned long from_size,
bdrecord_t *brec;
bdfile_t bdf;

if (delta_prepare(from_buf, from_size, &bdf))
if (!from_size || !to_size || delta_prepare(from_buf, from_size, &bdf))
return NULL;

outpos = 0;
Expand Down

0 comments on commit c7a45bd

Please sign in to comment.