summaryrefslogtreecommitdiff
path: root/imap/src/c-client/json.c
diff options
context:
space:
mode:
Diffstat (limited to 'imap/src/c-client/json.c')
-rw-r--r--imap/src/c-client/json.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/imap/src/c-client/json.c b/imap/src/c-client/json.c
index fbc5aa9c..973c8ff5 100644
--- a/imap/src/c-client/json.c
+++ b/imap/src/c-client/json.c
@@ -453,10 +453,15 @@ json_assign(void **v, JSON_S *j, char *s, JObjType t)
{
JSON_S *json = json_body_value(j, s);
+ *v = NIL;
if(json && json->jtype == t && json->value){
- switch(t){ /* override here */
- case JString : *v = (void *) cpystr((char *) json->value); break;
- default : break;
+ switch(t){
+ case JString : *v = (void *) cpystr((char *) json->value);
+ break;
+ case JArray :
+ case JObject : *v = json->value;
+ break;
+ default : break; /* use default value for *v */
}
}
}