From 34171f70ed59100b5371ba81341da66dc186782b Mon Sep 17 00:00:00 2001 From: sin Date: Mon, 15 Sep 2014 15:21:02 +0100 Subject: Fix off-by-one --- ratatox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ratatox.c') diff --git a/ratatox.c b/ratatox.c index d988d85..6992656 100644 --- a/ratatox.c +++ b/ratatox.c @@ -518,7 +518,7 @@ friendcreate(int32_t fid) blabla(f, "online", "w", tox_get_friend_connection_status(tox, fid) == 0 ? "0\n" : "1\n"); r = tox_get_status_message_size(tox, fid); - if (r > TOX_MAX_STATUSMESSAGE_LENGTH + 1) + if (r > TOX_MAX_STATUSMESSAGE_LENGTH) r = TOX_MAX_STATUSMESSAGE_LENGTH; statusmsg[r] = '\0'; blabla(f, "statusmsg", "w", "%s\n", statusmsg); -- cgit v1.2.3