diff options
author | irungentoo <irungentoo@gmail.com> | 2013-09-07 13:27:44 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-09-07 13:27:44 -0400 |
commit | bdf31fc6b55646fd798f5d39aeb5751f4a5319e7 (patch) | |
tree | aa43b5f3d0125d3892a4d80f94ebe515e4a9587d /toxcore/Messenger.c | |
parent | 64570a1b12d308449aa0d688f7f513847d1dc0f7 (diff) |
Added TODO list and made m_copy*_statusmessage functions return length of copied buffer on success.
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r-- | toxcore/Messenger.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 846bed6d..a1abce41 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c | |||
@@ -462,15 +462,15 @@ int m_copy_statusmessage(Messenger *m, int friendnumber, uint8_t *buf, uint32_t | |||
462 | return -1; | 462 | return -1; |
463 | 463 | ||
464 | memset(buf, 0, maxlen); | 464 | memset(buf, 0, maxlen); |
465 | memcpy(buf, m->friendlist[friendnumber].statusmessage, MIN(maxlen, MAX_STATUSMESSAGE_LENGTH) - 1); | 465 | memcpy(buf, m->friendlist[friendnumber].statusmessage, MIN(maxlen, m->friendlist[friendnumber].statusmessage_length)); |
466 | return 0; | 466 | return MIN(maxlen, m->friendlist[friendnumber].statusmessage_length); |
467 | } | 467 | } |
468 | 468 | ||
469 | int m_copy_self_statusmessage(Messenger *m, uint8_t *buf, uint32_t maxlen) | 469 | int m_copy_self_statusmessage(Messenger *m, uint8_t *buf, uint32_t maxlen) |
470 | { | 470 | { |
471 | memset(buf, 0, maxlen); | 471 | memset(buf, 0, maxlen); |
472 | memcpy(buf, m->statusmessage, MIN(maxlen, MAX_STATUSMESSAGE_LENGTH) - 1); | 472 | memcpy(buf, m->statusmessage, MIN(maxlen, m->statusmessage_length)); |
473 | return 0; | 473 | return MIN(maxlen, m->statusmessage_length); |
474 | } | 474 | } |
475 | 475 | ||
476 | USERSTATUS m_get_userstatus(Messenger *m, int friendnumber) | 476 | USERSTATUS m_get_userstatus(Messenger *m, int friendnumber) |