summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ospfd/parse.y
diff options
context:
space:
mode:
authordoug <doug@openbsd.org>2014-11-02 00:22:00 +0000
committerdoug <doug@openbsd.org>2014-11-02 00:22:00 +0000
commit9c81ce9f2cd71275760d8b9ee902dc2b801e86ba (patch)
tree020d58c5d9bf76c934fb178dc63d8f0c6a10eb58 /usr.sbin/ospfd/parse.y
parentOnly mark segment 0 as executable on 64-bit systems. There it is harmless as (diff)
downloadwireguard-openbsd-9c81ce9f2cd71275760d8b9ee902dc2b801e86ba.tar.xz
wireguard-openbsd-9c81ce9f2cd71275760d8b9ee902dc2b801e86ba.zip
Add gcc format attributes to parse.y for ospf{6,}d.
Fix a few yyerror() lines that are missing arguments. ok claudio@ sthen@
Diffstat (limited to 'usr.sbin/ospfd/parse.y')
-rw-r--r--usr.sbin/ospfd/parse.y12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/ospfd/parse.y b/usr.sbin/ospfd/parse.y
index fc3d9265c05..b95b4670254 100644
--- a/usr.sbin/ospfd/parse.y
+++ b/usr.sbin/ospfd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.76 2014/01/22 00:21:16 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.77 2014/11/02 00:22:00 doug Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -56,7 +56,9 @@ int popfile(void);
int check_file_secrecy(int, const char *);
int yyparse(void);
int yylex(void);
-int yyerror(const char *, ...);
+int yyerror(const char *, ...)
+ __attribute__((__format__ (printf, 1, 2)))
+ __attribute__((__nonnull__ (1)));
int kw_cmp(const void *, const void *);
int lookup(char *);
int lgetc(int);
@@ -560,7 +562,8 @@ areaoptsl : interface
if (strlcpy(area->demote_group, $2,
sizeof(area->demote_group)) >=
sizeof(area->demote_group)) {
- yyerror("demote group name \"%s\" too long");
+ yyerror("demote group name \"%s\" too long",
+ $2);
free($2);
YYERROR;
}
@@ -668,7 +671,8 @@ interfaceoptsl : PASSIVE { iface->passive = 1; }
if (strlcpy(iface->demote_group, $2,
sizeof(iface->demote_group)) >=
sizeof(iface->demote_group)) {
- yyerror("demote group name \"%s\" too long");
+ yyerror("demote group name \"%s\" too long",
+ $2);
free($2);
YYERROR;
}