API /last could crash with Greenwich defined

This commit is contained in:
Jan-Piet Mens 2015-11-11 21:30:14 +01:00
parent 996e5c478a
commit 67851bf217

View File

@ -155,6 +155,9 @@ static void get_gw_data(char *username, char *device, JsonNode *last)
char **t, *js;
static UT_string *ts = NULL;
if (last == NULL || last->tag != JSON_OBJECT)
return;
for (t = types; t && *t; t++) {
utstring_renew(ts);
utstring_printf(ts, "%s/last/%s/%s/%s.json",
@ -193,8 +196,6 @@ void append_device_details(JsonNode *userlist, char *user, char *device)
}
json_append_element(userlist, last);
} else {
json_delete(last);
}
snprintf(path, BUFSIZ, "%s/cards/%s/%s.json",