%{ /* deffilep.y - parser for .def files */
-/* Copyright 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006,
- 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
This file is part of GNU Binutils.
/* Scan forward until we encounter any of:
- the end of the buffer
- the start of a new option
- - a newline seperating options
- - a NUL seperating options. */
+ - a newline separating options
+ - a NUL separating options. */
for (tend = (char *) (param + 1);
(tend < pend
&& !(ISSPACE (tend[-1]) && *tend == '-')
if (!diropts[i].param)
{
- char saved;
+ if (tend < pend)
+ {
+ char saved;
- saved = * tend;
- * tend = 0;
- /* xgettext:c-format */
- einfo (_("Warning: .drectve `%s' unrecognized\n"), param);
- * tend = saved;
+ saved = * tend;
+ * tend = 0;
+ /* xgettext:c-format */
+ einfo (_("Warning: .drectve `%s' unrecognized\n"), param);
+ * tend = saved;
+ }
+ else
+ {
+ einfo (_("Warning: corrupt .drectve at end of def file\n"));
+ }
}
lex_parse_string = 0;