Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
idnode: Fix sorting for bool and time types
  • Loading branch information
perexg committed Sep 8, 2014
1 parent c2680b5 commit 0e6c737
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/idnode.c
Expand Up @@ -424,8 +424,11 @@ idnode_get_bool
const property_t *p = idnode_find_prop(self, key);
if (p->islist) return 1;
if (p) {
void *ptr = self;
ptr += p->off;
const void *ptr;
if (p->get)
ptr = p->get(self);
else
ptr = ((void*)self) + p->off;
switch (p->type) {
case PT_BOOL:
*b = *(int*)ptr;
Expand All @@ -447,8 +450,11 @@ idnode_get_time
const property_t *p = idnode_find_prop(self, key);
if (p->islist) return 1;
if (p) {
void *ptr = self;
ptr += p->off;
const void *ptr;
if (p->get)
ptr = p->get(self);
else
ptr = ((void*)self) + p->off;
switch (p->type) {
case PT_TIME:
*tm = *(time_t*)ptr;
Expand Down

0 comments on commit 0e6c737

Please sign in to comment.