Skip to content

Commit

Permalink
Replace remaining instances of strdup with xstrdup.
Browse files Browse the repository at this point in the history
Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
James Bowes authored and Junio C Hamano committed Mar 20, 2007
1 parent 5e08ecb commit 567fb65
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion builtin-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
if (!prefixcmp(arg, "--encoding=")) {
arg += 11;
if (strcmp(arg, "none"))
git_log_output_encoding = strdup(arg);
git_log_output_encoding = xstrdup(arg);
else
git_log_output_encoding = "";
}
Expand Down
2 changes: 1 addition & 1 deletion commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ static char *logmsg_reencode(const struct commit *commit,
encoding = get_header(commit, "encoding");
use_encoding = encoding ? encoding : utf8;
if (!strcmp(use_encoding, output_encoding))
out = strdup(commit->buffer);
out = xstrdup(commit->buffer);
else
out = reencode_string(commit->buffer,
output_encoding, use_encoding);
Expand Down
2 changes: 1 addition & 1 deletion revision.c
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
if (!prefixcmp(arg, "--encoding=")) {
arg += 11;
if (strcmp(arg, "none"))
git_log_output_encoding = strdup(arg);
git_log_output_encoding = xstrdup(arg);
else
git_log_output_encoding = "";
continue;
Expand Down

0 comments on commit 567fb65

Please sign in to comment.