Replace remaining instances of strdup with xstrdup.

Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
James Bowes 2007-03-19 17:42:40 -04:00 committed by Junio C Hamano
parent 5e08ecbff2
commit 567fb65e25
3 changed files with 3 additions and 3 deletions

View File

@ -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 = "";
}

View File

@ -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);

View File

@ -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;