summaryrefslogtreecommitdiff
path: root/usr.bin/cvs
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2006-05-03 14:26:14 +0000
committerRay Lai <ray@cvs.openbsd.org>2006-05-03 14:26:14 +0000
commit8f4c99324e23acb102b0dd3f9497923a5639624e (patch)
tree813c6ad2649c5c6e36f4dfa50b77055eb6e27df9 /usr.bin/cvs
parent1ee1efcc1f59b70d41e53d158619f98e43ea0976 (diff)
Use xasprintf and xfree.
``But i thought it already went in...'' xsa@
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r--usr.bin/cvs/date.y11
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.bin/cvs/date.y b/usr.bin/cvs/date.y
index 722df234635..a7893dff65d 100644
--- a/usr.bin/cvs/date.y
+++ b/usr.bin/cvs/date.y
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: date.y,v 1.12 2006/04/29 04:42:46 ray Exp $ */
+/* $OpenBSD: date.y,v 1.13 2006/05/03 14:26:13 ray Exp $ */
/*
** Originally written by Steven M. Bellovin <smb@research.att.com> while
@@ -484,23 +484,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
cvs_log(LP_ERR, "%s", str);
#endif
- free(str);
+ xfree(str);
return (0);
}