summaryrefslogtreecommitdiff
path: root/usr.bin/rcs
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/rcs
parent1ee1efcc1f59b70d41e53d158619f98e43ea0976 (diff)
Use xasprintf and xfree.
``But i thought it already went in...'' xsa@
Diffstat (limited to 'usr.bin/rcs')
-rw-r--r--usr.bin/rcs/date.y11
1 files changed, 4 insertions, 7 deletions
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 <smb@research.att.com> 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);
}