From: Adam Sutton Date: Mon, 9 Jun 2014 21:06:29 +0000 (+0100) Subject: prop: fix bug in handling PT_INT which should be signed X-Git-Tag: v4.1~1998 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5f9979852934804b9944da91e7431143dfa42d1;p=thirdparty%2Ftvheadend.git prop: fix bug in handling PT_INT which should be signed --- diff --git a/src/prop.c b/src/prop.c index 37084d0d9..79a548b82 100644 --- a/src/prop.c +++ b/src/prop.c @@ -68,6 +68,7 @@ prop_write_values const void *new; double dbl; int i; + int64_t s64; uint32_t u32; uint16_t u16; #define PROP_UPDATE(v, t)\ @@ -107,9 +108,9 @@ prop_write_values break; } case PT_INT: { - if (htsmsg_field_get_u32(f, &u32)) + if (htsmsg_field_get_s64(f, &s64)) continue; - i = u32; + i = s64; PROP_UPDATE(i, int); break; } @@ -293,7 +294,7 @@ prop_serialize htsmsg_add_bool(m, "default", pl->def.i); break; case PT_INT: - htsmsg_add_u32(m, "default", pl->def.i); + htsmsg_add_s32(m, "default", pl->def.i); break; case PT_U16: htsmsg_add_u32(m, "default", pl->def.u16);