aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rw-r--r--misc/hsearch_r.c4
-rw-r--r--misc/tst-fdset.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/misc/hsearch_r.c b/misc/hsearch_r.c
index d9255e1..fbf55ee 100644
--- a/misc/hsearch_r.c
+++ b/misc/hsearch_r.c
@@ -187,6 +187,10 @@ hsearch_r (item, action, retval, htab)
else
idx -= hval2;
+ /* If we visited all entries leave the loop unsuccessfully. */
+ if (idx == hval)
+ break;
+
/* If entry is found use it. */
if (htab->table[idx].used == hval
&& strcmp (item.key, htab->table[idx].entry.key) == 0)
diff --git a/misc/tst-fdset.c b/misc/tst-fdset.c
index ddd25c3..14372cf 100644
--- a/misc/tst-fdset.c
+++ b/misc/tst-fdset.c
@@ -42,7 +42,7 @@ main (void)
fputs (", set", stdout);
FD_SET (i, &set);
fputs (", check:", stdout);
- if (FD_ISSET (i, &set) == 1)
+ if (FD_ISSET (i, &set))
fputs ("ok", stdout);
else
{