summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2012-09-03 17:53:56 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-09-04 10:16:58 +0200
commitb38fa5219f2f8ae3b6366ab911d9662f9340f70d (patch)
treed22342d4b8eb62a498921db8d59d284ecbaf650c
parentd8e7609abbda70ea5daae8de40749e7377bf99c2 (diff)
downloadrsyslog-b38fa5219f2f8ae3b6366ab911d9662f9340f70d.tar.gz
rsyslog-b38fa5219f2f8ae3b6366ab911d9662f9340f70d.tar.bz2
rsyslog-b38fa5219f2f8ae3b6366ab911d9662f9340f70d.zip
Set value of a mandatory JSON field to null
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
-rw-r--r--template.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/template.c b/template.c
index 6bcca42b..74a87c99 100644
--- a/template.c
+++ b/template.c
@@ -307,14 +307,9 @@ rsRetVal tplToJSON(struct template *pTpl, msg_t *pMsg, struct json_object **pjso
} else {
DBGPRINTF("tplToJSON: error %d looking up property\n",
localRet);
-#if 0 /* TODO: as it looks, there currently is no way to define Null field values in json-c...
- we need to think how we will handle that.
- */
if(pTpe->data.field.options.bMandatory) {
- jsonf = json_object_new(json_type_null); //json_object_new_null();
- json_object_object_add(json, (char*)pTpe->fieldName, jsonf);
+ json_object_object_add(json, (char*)pTpe->fieldName, NULL);
}
-#endif
}
} else {
pVal = (uchar*) MsgGetProp(pMsg, pTpe, pTpe->data.field.propid,