From 8f4c99324e23acb102b0dd3f9497923a5639624e Mon Sep 17 00:00:00 2001 From: Ray Lai Date: Wed, 3 May 2006 14:26:14 +0000 Subject: Use xasprintf and xfree. ``But i thought it already went in...'' xsa@ --- usr.bin/rcs/date.y | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'usr.bin/rcs') diff --git a/usr.bin/rcs/date.y b/usr.bin/rcs/date.y index 5af444b656f..71946fba449 100644 --- a/usr.bin/rcs/date.y +++ b/usr.bin/rcs/date.y @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: date.y,v 1.2 2006/04/29 04:42:47 ray Exp $ */ +/* $OpenBSD: date.y,v 1.3 2006/05/03 14:26:13 ray Exp $ */ /* ** Originally written by Steven M. Bellovin while @@ -483,23 +483,20 @@ static int yyerror(const char *s) { char *str; - int n; if (isspace(yyInput[0]) || !isprint(yyInput[0])) - n = asprintf(&str, "%s: unexpected char 0x%02x in date string", + (void)xasprintf(&str, "%s: unexpected char 0x%02x in date string", s, yyInput[0]); else - n = asprintf(&str, "%s: unexpected %s in date string", + (void)xasprintf(&str, "%s: unexpected %s in date string", s, yyInput); - if (n == -1) - return (0); #if defined(TEST) printf("%s", str); #else warnx("%s", str); #endif - free(str); + xfree(str); return (0); } -- cgit v1.2.3