Homebrew Data abort when trying to create Jansson object.

mogery

Well-Known Member
OP
Member
Joined
Dec 28, 2016
Messages
161
Trophies
0
Location
Hungary
XP
490
Country
Hungary
I am currently trying to make a Jansson JSON object and then "stringify" it for some other function I use that needs JSON.

Code:
#include <jansson.h>
#include <3ds.h>

int myFunction(int* setErr) {
    json_t* req = json_object();
    *setErr = json_string_set(json_object_get(req, "email"), "foo");
    if(setErr != 0){
        return -1;
    }
    *setErr = json_string_set(json_object_get(req, "password"), "bar");
    if(setErr != 0){
        return -1;
    }
    someOtherFuncion(json_dumps(req, JSON_COMPACT));
    return 0;
}

According to addr2line, line 6 (*setErr = json_string_set(...)) is causing a data abort exception.

What is the correct way to create a JSON object from scratch?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: Where's everybody?