From 14089cee5b4948037fbb17e8e0c07ecd788678f3 Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Wed, 4 Apr 2018 07:59:19 +0000 Subject: [PATCH] Assign type when from_str is called FossilOrigin-Name: 1296e279dd43d32945cd2fae3251a212796fc78df8d48b7066e03131c4098800 --- src/cw/cw_type_bool.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cw/cw_type_bool.c b/src/cw/cw_type_bool.c index a5ca29b6..7bd3855f 100644 --- a/src/cw/cw_type_bool.c +++ b/src/cw/cw_type_bool.c @@ -23,14 +23,14 @@ static cw_KTV_t *get(cw_KTV_t * data, const uint8_t * src, int len) { - data->type = &cw_type_byte; - data->val.byte = cw_get_byte(src); + data->type = &cw_type_bool; + data->val.boolean = cw_get_byte(src); return data; } static int put(const cw_KTV_t *data, uint8_t * dst) { - return cw_put_byte(dst, data->val.byte); + return cw_put_byte(dst, data->val.boolean); } static int to_str(const cw_KTV_t *data, char *dst, int max_len) @@ -46,6 +46,7 @@ static int to_str(const cw_KTV_t *data, char *dst, int max_len) static cw_KTV_t *from_str(cw_KTV_t * data, const char *src) { + data->type = &cw_type_bool; if (cw_stricmp(src,"true") == 0){ data->val.boolean=1; return data;