summaryrefslogtreecommitdiffstats
path: root/src/idmap.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-01-07 14:06:45 -0600
committerDenis Kenzior <denkenz@gmail.com>2010-01-07 14:06:45 -0600
commit4e621f3ad38286c71b7c9c3f837415d1b9415008 (patch)
treedc4c5917658c4ba10c1fed027ed7e9d5fbc912b8 /src/idmap.c
parent0ed5c700109c4a824c40965fb53a53be2a9e264d (diff)
downloadofono-4e621f3ad38286c71b7c9c3f837415d1b9415008.tar.bz2
Change the semantics to return id > max on failure
Diffstat (limited to 'src/idmap.c')
-rw-r--r--src/idmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/idmap.c b/src/idmap.c
index a42bf118..b69b0333 100644
--- a/src/idmap.c
+++ b/src/idmap.c
@@ -146,7 +146,7 @@ unsigned int idmap_alloc(struct idmap *idmap)
bit = find_next_zero_bit(idmap->bits, idmap->size, 0);
if (bit >= idmap->size)
- return 0;
+ return idmap->max + 1;
offset = bit / BITS_PER_LONG;
idmap->bits[offset] |= 1 << (bit % BITS_PER_LONG);