+2000-04-19 Tom Tromey <tromey@cygnus.com>
+
+ * gjavah.c (cxx_keyword_subst): Avoid potential infinite loop.
+
2000-04-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (maybe_make_nested_class_name): Use `obstack_grow0'.
{
int last = sizeof (cxx_keywords) / sizeof (const char *);
int first = 0;
- int mid, r;
+ int mid = (last + first) / 2;
+ int old = -1;
- while (last != first)
+ for (mid = (last + first) / 2;
+ mid != old;
+ old = mid, mid = (last + first) / 2)
{
- mid = (last + first) / 2;
- r = utf8_cmp (str, length, cxx_keywords[mid]);
+ int r = utf8_cmp (str, length, cxx_keywords[mid]);
+
if (r == 0)
{
char *str = xmalloc (9 + strlen (cxx_keywords[mid]));