commit - 17410fed5985559b38f8be4ffe7a550af2cd9b96
commit + d5faed8f62550914f4e06a8b1464702aa39d1c0b
blob - 09dda969a1603ce0214a117f11d6df008a4f9adb
blob + 5a40ba7e79d21c2038ec1aad6b877d1b89ed1dec
--- fight.c
+++ fight.c
{
struct character *curchar = get_current_character();
char path[_POSIX_PATH_MAX];
- json_object *root, *items;
+ json_object *root, *items, *id;
int temp_n, i;
if (curchar == NULL) {
temp_n = json_object_array_length(items);
for (i = 0; i < temp_n; i++) {
json_object *temp = json_object_array_get_idx(items, i);
- json_object *id = json_object_object_get(temp, "id");
+ json_object_object_get_ex(temp, "id", &id);
if (curchar->id == json_object_get_int(id)) {
log_debug("Update fight entry for %s\n", curchar->name);
json_object_array_del_idx(items, i, 1);
delete_fight(int id)
{
char path[_POSIX_PATH_MAX];
- json_object *root;
+ json_object *root, *lid;
int temp_n, i;
snprintf(path, sizeof(path), "%s/fight.json", get_isscrolls_dir());
temp_n = json_object_array_length(fight);
for (i = 0; i < temp_n; i++) {
json_object *temp = json_object_array_get_idx(fight, i);
- json_object *lid = json_object_object_get(temp, "id");
+ json_object_object_get_ex(temp, "id", &lid);
if (id == json_object_get_int(lid)) {
json_object_array_del_idx(fight, i, 1);
log_debug("Deleted fight entry for %d\n", id);
{
struct character *curchar = get_current_character();
char path[_POSIX_PATH_MAX];
- json_object *root;
+ json_object *root, *lid;
int temp_n, i;
if (curchar == NULL) {
temp_n = json_object_array_length(fight);
for (i=0; i < temp_n; i++) {
json_object *temp = json_object_array_get_idx(fight, i);
- json_object *lid = json_object_object_get(temp, "id");
+ json_object_object_get_ex(temp, "id", &lid);
if (id == json_object_get_int(lid)) {
log_debug("Loading fight for id: %d\n", json_object_get_int(lid));
blob - 76783c44f134361d41992aae4af524c005fe5c3d
blob + 5a7c3a3c9eccbf5a3aeb3788dd611dbd8577a2ed
--- journey.c
+++ journey.c
{
struct character *curchar = get_current_character();
char path[_POSIX_PATH_MAX];
- json_object *root, *items;
+ json_object *root, *items, *id;
int temp_n, i;
if (curchar == NULL) {
temp_n = json_object_array_length(items);
for (i = 0; i < temp_n; i++) {
json_object *temp = json_object_array_get_idx(items, i);
- json_object *id = json_object_object_get(temp, "id");
+ json_object_object_get_ex(temp, "id", &id);
if (curchar->id == json_object_get_int(id)) {
log_debug("Update journey entry for %s\n", curchar->name);
json_object_array_del_idx(items, i, 1);
delete_journey(int id)
{
char path[_POSIX_PATH_MAX];
- json_object *root;
+ json_object *root, *lid;
int temp_n, i;
snprintf(path, sizeof(path), "%s/journey.json", get_isscrolls_dir());
temp_n = json_object_array_length(journey);
for (i = 0; i < temp_n; i++) {
json_object *temp = json_object_array_get_idx(journey, i);
- json_object *lid = json_object_object_get(temp, "id");
+ json_object_object_get_ex(temp, "id", &lid);
if (id == json_object_get_int(lid)) {
json_object_array_del_idx(journey, i, 1);
log_debug("Deleted journey entry for %d\n", id);
{
struct character *curchar = get_current_character();
char path[_POSIX_PATH_MAX];
- json_object *root;
+ json_object *root, *lid;
int temp_n, i;
if (curchar == NULL) {
temp_n = json_object_array_length(journey);
for (i=0; i < temp_n; i++) {
json_object *temp = json_object_array_get_idx(journey, i);
- json_object *lid = json_object_object_get(temp, "id");
+ json_object_object_get_ex(temp, "id", &lid);
if (id == json_object_get_int(lid)) {
log_debug("Loading journey for id: %d\n", json_object_get_int(lid));