git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] diff.c: replace a 'strdup' with 'xstrdup'.

From
Christian Couder <chriscool@tuxfamily.org>
Date
Feb 14, 2008, 05:50 UTC
Message-ID
<20080214065000.083c3617.chriscool@tuxfamily.org>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 diff.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
	By the way perhaps the 
 		return error("%s: lacks value", var);
	should also be changed to
		return config_error_nonbool(var);
	or the check could be removed because there is
	already a check line 171 just before
	'parse_lldiff_command' is called.
diff --git a/diff.c b/diff.c
index cd8bc4d..e5db293 100644
--- a/diff.c
+++ b/diff.c
@@ -88,7 +88,7 @@ static int parse_lldiff_command(const char *var, const char *ep, const char *val
 
 	if (!value)
 		return error("%s: lacks value", var);
-	drv->cmd = strdup(value);
+	drv->cmd = xstrdup(value);
 	return 0;
 }
 
-- 
1.5.4.20.gc135a-dirty
Next: Junio C Hamano
Message 1 of 2 in “diff.c: replace a 'strdup' with 'xstrdup'.”
  1. diff.c: replace a 'strdup' with 'xstrdup'.Christian Couder, Feb 14, 2008
  2. Junio C HamanoFeb 15, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.