Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "dangling pointer" warning #1268

Merged
merged 1 commit into from
Aug 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/stage.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ static bool
find_deleted_line_in_head(struct view *view, struct line *line) {
struct io io;
struct buffer buffer;
struct status file_status;
unsigned long line_number_in_head, line_number = 0;
long bias_by_staged_changes = 0;
char buf[SIZEOF_STR] = "";
Expand All @@ -466,7 +467,6 @@ find_deleted_line_in_head(struct view *view, struct line *line) {
if (buf[0]) {
file_in_head = view->env->file;
} else { // The file might might be renamed in the index. Find its old name.
struct status file_status;
const char *diff_index_argv[] = {
"git", "diff-index", "--cached", "-C",
"--diff-filter=ACR", "-z", "HEAD", NULL
Expand Down