aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-11-03 10:23:13 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-11-03 10:23:13 +0000
commit7fb60612e19e72a876edc9501a36c8ca3f088e68 (patch)
tree63d1b77ba814b47f1378475f7078c8f31756c547 /src
parentbb6169400ef16b3dd4d54b171849b3d7877c651e (diff)
downloadrspamd-7fb60612e19e72a876edc9501a36c8ca3f088e68.tar.gz
rspamd-7fb60612e19e72a876edc9501a36c8ca3f088e68.zip
Parse unsigned integers in the configuration.
Diffstat (limited to 'src')
-rw-r--r--src/libserver/cfg_rcl.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c
index c7ccdccbe..9bb8fecfc 100644
--- a/src/libserver/cfg_rcl.c
+++ b/src/libserver/cfg_rcl.c
@@ -1672,6 +1672,7 @@ rspamd_rcl_parse_struct_integer (struct rspamd_config *cfg,
gint32 *i32p;
gint16 *i16p;
gint64 *i64p;
+ guint *up;
gsize *sp;
} target;
gint64 val;
@@ -1720,6 +1721,17 @@ rspamd_rcl_parse_struct_integer (struct rspamd_config *cfg,
}
*target.i16p = val;
}
+ else if (pd->flags == RSPAMD_CL_FLAG_UINT) {
+ target.up = (guint *)(((gchar *)pd->user_struct) + pd->offset);
+ if (!ucl_object_toint_safe (obj, &val)) {
+ g_set_error (err,
+ CFG_RCL_ERROR,
+ EINVAL,
+ "cannot convert param to integer");
+ return FALSE;
+ }
+ *target.up = val;
+ }
else {
target.ip = (gint *)(((gchar *)pd->user_struct) + pd->offset);
if (!ucl_object_toint_safe (obj, &val)) {