threads / patch / 12083

patchdiff.c: replace a 'strdup' with 'xstrdup'.

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

## tl;dr

2 messages between Feb 14, 2008 and Feb 15, 2008. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Christian Couder· Feb 14, 2008, 05:50 UTC · lore
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.
Show changes to diff.c +1 −1
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
Junio C Hamano· Feb 15, 2008, 17:11 UTC · re: Christian Couder · lore

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

Christian Couder <chriscool@tuxfamily.org> writes:
Show 7 quoted lines
> 	By the way perhaps the 
>
>  		return error("%s: lacks value", var);
>
> 	should also be changed to
>
> 		return config_error_nonbool(var);
Good eyes.  That probably should go to 'maint' for consistency.

← back to recent threads