X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-apply.c;h=dfa17167963d1318298208e880be1cae47d06ea9;hb=e286114d0edbed846149227d48f75338fea760e5;hp=b84d747e3f3117570db5a2089c2abe67a611cb02;hpb=c4f8f827555dcbbee148fd1daa4821533ead2ea2;p=git.git diff --git a/builtin-apply.c b/builtin-apply.c index b84d747e3..dfa171679 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -1912,11 +1912,11 @@ static int apply_binary(struct buffer_desc *desc, struct patch *patch) if (has_sha1_file(sha1)) { /* We already have the postimage */ - char type[10]; + enum object_type type; unsigned long size; free(desc->buffer); - desc->buffer = read_sha1_file(sha1, type, &size); + desc->buffer = read_sha1_file(sha1, &type, &size); if (!desc->buffer) return error("the necessary postimage %s for " "'%s' cannot be read", @@ -1972,8 +1972,8 @@ static int apply_data(struct patch *patch, struct stat *st, struct cache_entry * buf = NULL; if (cached) { if (ce) { - char type[20]; - buf = read_sha1_file(ce->sha1, type, &size); + enum object_type type; + buf = read_sha1_file(ce->sha1, &type, &size); if (!buf) return error("read of %s failed", patch->old_name); @@ -1981,7 +1981,7 @@ static int apply_data(struct patch *patch, struct stat *st, struct cache_entry * } } else if (patch->old_name) { - size = st->st_size; + size = xsize_t(st->st_size); alloc = size + 8192; buf = xmalloc(alloc); if (read_old_data(st, patch->old_name, &buf, &alloc, &size)) @@ -2359,7 +2359,7 @@ static int try_create_file(const char *path, unsigned int mode, const char *buf, char *nbuf; unsigned long nsize; - if (S_ISLNK(mode)) + if (has_symlinks && S_ISLNK(mode)) /* Although buf:size is counted string, it also is NUL * terminated. */