diff options
| author | dartraiden <wowemuh@gmail.com> | 2022-02-07 00:34:21 +0300 |
|---|---|---|
| committer | dartraiden <wowemuh@gmail.com> | 2022-02-07 00:35:37 +0300 |
| commit | 223306302f39455970b67a97ba62e4a542224f7a (patch) | |
| tree | 21da0622af231bea688b413d1238d15315d658ce /protocols/Tox/libtox/src/toxcore/state.c | |
| parent | 41317031f257ad6a06fa743860aff212074dc416 (diff) | |
Update libtox to 0.2.15
Diffstat (limited to 'protocols/Tox/libtox/src/toxcore/state.c')
| -rw-r--r-- | protocols/Tox/libtox/src/toxcore/state.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/protocols/Tox/libtox/src/toxcore/state.c b/protocols/Tox/libtox/src/toxcore/state.c index 13ae8e7189..a31768131a 100644 --- a/protocols/Tox/libtox/src/toxcore/state.c +++ b/protocols/Tox/libtox/src/toxcore/state.c @@ -6,7 +6,7 @@ #include <string.h> -/* state load/save */ +/** state load/save */ int state_load(const Logger *log, state_load_cb *state_load_callback, void *outer, const uint8_t *data, uint32_t length, uint16_t cookie_inner) { @@ -34,7 +34,7 @@ int state_load(const Logger *log, state_load_cb *state_load_callback, void *oute return -1; } - if (lendian_to_host16((cookie_type >> 16)) != cookie_inner) { + if (lendian_to_host16(cookie_type >> 16) != cookie_inner) { /* something is not matching up in a bad way, give up */ LOGGER_ERROR(log, "state file garbled: %04x != %04x", cookie_type >> 16, cookie_inner); return -1; @@ -43,17 +43,20 @@ int state_load(const Logger *log, state_load_cb *state_load_callback, void *oute const uint16_t type = lendian_to_host16(cookie_type & 0xFFFF); switch (state_load_callback(outer, data, length_sub, type)) { - case STATE_LOAD_STATUS_CONTINUE: + case STATE_LOAD_STATUS_CONTINUE: { data += length_sub; length -= length_sub; break; + } - case STATE_LOAD_STATUS_ERROR: + case STATE_LOAD_STATUS_ERROR: { LOGGER_ERROR(log, "Error occcured in state file (type: %u).", type); return -1; + } - case STATE_LOAD_STATUS_END: + case STATE_LOAD_STATUS_END: { return 0; + } } } |
