[PATCH] use xstrdup please

Previous thread: Re: [RFC] Add --index to git-commit: just commit current index by Junio C Hamano on Thursday, March 15, 2007 - 5:23 pm. (2 messages)

Next thread: cleaner/better zlib sources? by Linus Torvalds on Thursday, March 15, 2007 - 6:04 pm. (79 messages)
From: Shawn O. Pearce
Date: Thursday, March 15, 2007 - 6:02 pm

We generally prefer xstrdup to just plain strdup.
Make it so.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 config.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/config.c b/config.c
index a3c7b77..d537311 100644
--- a/config.c
+++ b/config.c
@@ -351,12 +351,12 @@ int git_default_config(const char *var, const char *value)
 	}
 
 	if (!strcmp(var, "i18n.commitencoding")) {
-		git_commit_encoding = strdup(value);
+		git_commit_encoding = xstrdup(value);
 		return 0;
 	}
 
 	if (!strcmp(var, "i18n.logoutputencoding")) {
-		git_log_output_encoding = strdup(value);
+		git_log_output_encoding = xstrdup(value);
 		return 0;
 	}
 
-- 
1.5.0.4.1009.gd3da
-

Previous thread: Re: [RFC] Add --index to git-commit: just commit current index by Junio C Hamano on Thursday, March 15, 2007 - 5:23 pm. (2 messages)

Next thread: cleaner/better zlib sources? by Linus Torvalds on Thursday, March 15, 2007 - 6:04 pm. (79 messages)