diff options
-rw-r--r-- | builtin/mv.c | 3 | ||||
-rw-r--r-- | notes-utils.c | 2 | ||||
-rw-r--r-- | streaming.c | 4 | ||||
-rw-r--r-- | utf8.c | 6 |
4 files changed, 9 insertions, 6 deletions
diff --git a/builtin/mv.c b/builtin/mv.c index 21c46d1636..7e26eb5229 100644 --- a/builtin/mv.c +++ b/builtin/mv.c @@ -162,7 +162,8 @@ int cmd_mv(int argc, const char **argv, const char *prefix) if (strncmp(path, src_w_slash, len_w_slash)) break; } - free((char *)src_w_slash); + if (src_w_slash != src) + free((char *)src_w_slash); if (last - first < 1) bad = _("source directory is empty"); diff --git a/notes-utils.c b/notes-utils.c index 2975dcd581..4aa7023903 100644 --- a/notes-utils.c +++ b/notes-utils.c @@ -75,7 +75,7 @@ static int notes_rewrite_config(const char *k, const char *v, void *cb) return 0; } else if (!c->mode_from_env && !strcmp(k, "notes.rewritemode")) { if (!v) - config_error_nonbool(k); + return config_error_nonbool(k); c->combine = parse_combine_notes_fn(v); if (!c->combine) { error(_("Bad notes.rewriteMode value: '%s'"), v); diff --git a/streaming.c b/streaming.c index d7c9f32f0c..2ff036a0fa 100644 --- a/streaming.c +++ b/streaming.c @@ -152,8 +152,10 @@ struct git_istream *open_istream(const unsigned char *sha1, if (filter) { /* Add "&& !is_null_stream_filter(filter)" for performance */ struct git_istream *nst = attach_stream_filter(st, filter); - if (!nst) + if (!nst) { close_istream(st); + return NULL; + } st = nst; } @@ -5,8 +5,8 @@ /* This code is originally from http://www.cl.cam.ac.uk/~mgk25/ucs/ */ struct interval { - int first; - int last; + ucs_char_t first; + ucs_char_t last; }; size_t display_mode_esc_sequence_len(const char *s) @@ -529,7 +529,7 @@ char *reencode_string_iconv(const char *in, size_t insz, iconv_t conv, int *outs while (1) { size_t cnt = iconv(conv, &cp, &insz, &outpos, &outsz); - if (cnt == -1) { + if (cnt == (size_t) -1) { size_t sofar; if (errno != E2BIG) { free(out); |