summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/cvs/date.y11
-rw-r--r--usr.bin/rcs/date.y11
2 files changed, 8 insertions, 14 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);
}
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);
}