mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fix bug where messages from yourself were preceeded by [-1]
This commit is contained in:
parent
ffd69a6525
commit
ff2e04b107
@ -89,7 +89,12 @@ char *format_message(char *message, int friendnum)
|
||||
char* time = asctime(timeinfo);
|
||||
size_t len = strlen(time);
|
||||
time[len-1] = '\0';
|
||||
sprintf(msg, "[%d] %s <%s> %s", friendnum, time, name, message); // timestamp
|
||||
if (friendnum != -1) {
|
||||
sprintf(msg, "[%d] %s <%s> %s", friendnum, time, name, message);
|
||||
} else {
|
||||
// This message came from ourselves
|
||||
sprintf(msg, "%s <%s> %s", time, name, message);
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user