summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2007-10-21 09:23:49 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-10-22 04:00:40 (GMT)
commitc32f749fec69f92ce3b076128e6322f8130bd881 (patch)
tree0ada7de6f324a57dccd4b7bba9eaa05091a252cc /diff.c
parent5be507fc955bd14643cac1162cfaa592d0e236ba (diff)
downloadgit-c32f749fec69f92ce3b076128e6322f8130bd881.zip
git-c32f749fec69f92ce3b076128e6322f8130bd881.tar.gz
git-c32f749fec69f92ce3b076128e6322f8130bd881.tar.bz2
Correct some sizeof(size_t) != sizeof(unsigned long) typing errors
Fix size_t vs. unsigned long pointer mismatch warnings introduced with the addition of strbuf_detach(). Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/diff.c b/diff.c
index 6648e01..dfb8595 100644
--- a/diff.c
+++ b/diff.c
@@ -1512,6 +1512,7 @@ static int reuse_worktree_file(const char *name, const unsigned char *sha1, int
static int populate_from_stdin(struct diff_filespec *s)
{
struct strbuf buf;
+ size_t size = 0;
strbuf_init(&buf, 0);
if (strbuf_read(&buf, 0, 0) < 0)
@@ -1519,7 +1520,8 @@ static int populate_from_stdin(struct diff_filespec *s)
strerror(errno));
s->should_munmap = 0;
- s->data = strbuf_detach(&buf, &s->size);
+ s->data = strbuf_detach(&buf, &size);
+ s->size = size;
s->should_free = 1;
return 0;
}
@@ -1609,9 +1611,11 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only)
*/
strbuf_init(&buf, 0);
if (convert_to_git(s->path, s->data, s->size, &buf)) {
+ size_t size = 0;
munmap(s->data, s->size);
s->should_munmap = 0;
- s->data = strbuf_detach(&buf, &s->size);
+ s->data = strbuf_detach(&buf, &size);
+ s->size = size;
s->should_free = 1;
}
}