diff options
Diffstat (limited to 'keyword.c')
-rw-r--r-- | keyword.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1,5 +1,10 @@ +#define _XOPEN_SOURCE +#include <stdint.h> +#include <stdlib.h> +#include <string.h> #include <time.h> #include "keyword.h" +#include "misc.h" void *get_keyword_offset_ptr(const keyword *key, void *ptr) { char *ret = (char *)(ptr+key->offsets[0]); @@ -44,7 +49,7 @@ int set_keyword(const keyword *key, keyword_val val, void *ret, void *ctx) { } else { char *tmp_ret = (char *)get_keyword_offset_ptr(key, ret); - switch (type) { + switch (key->type) { case TYPE_INT : case TYPE_BOOL : *(int *)tmp_ret = val.i; break; case TYPE_TIME : *(time_t *)tmp_ret = val.t; break; |