Skip to content

Commit

Permalink
Properly initialize variable in diff_get_pathname
Browse files Browse the repository at this point in the history
Fixes compiler warning: ‘dst’ may be used uninitialized in this
function.
  • Loading branch information
jonas committed Aug 24, 2012
1 parent f941be3 commit 9e09e02
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tig.c
Expand Up @@ -4447,7 +4447,8 @@ static const char *
diff_get_pathname(struct view *view, struct line *line)
{
const struct line *header;
const char *dst, *prefixes[] = { " b/", "cc ", "combined " };
const char *dst = NULL;
const char *prefixes[] = { " b/", "cc ", "combined " };
int i;

header = find_prev_line_by_type(view, line, LINE_DIFF_HEADER);
Expand Down

0 comments on commit 9e09e02

Please sign in to comment.