summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2012-07-08 10:42:09 -0400
committerRyan Lortie <desrt@desrt.ca>2012-07-08 10:42:09 -0400
commit0d25676ca1f7721564687cb4eabf43c5dfadd8ea (patch)
tree1662b364e869b9181d1a9891adae8d8cc00f57a0
parent9fca034e9fef29e17bdba9aa08a50d9fee28d55e (diff)
downloaddconf-0d25676ca1f7721564687cb4eabf43c5dfadd8ea.tar.gz
gvdb test: fix logic for infinite walks
We were using a negative variable for the value of a counter designed to bound the number of open() calls in a walk. We were decrementing it in that case (which is fine since it would never reach zero again anyway). It was a bit ugly, though.
-rw-r--r--tests/gvdb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/gvdb.c b/tests/gvdb.c
index 4f9c398..35a16a2 100644
--- a/tests/gvdb.c
+++ b/tests/gvdb.c
@@ -204,7 +204,8 @@ walk_open (const gchar *name,
if (accept_this_many_opens)
{
- accept_this_many_opens--;
+ if (accept_this_many_opens > 0)
+ accept_this_many_opens--;
return TRUE;
}