diff options
Diffstat (limited to 'toxcore/network.c')
-rw-r--r-- | toxcore/network.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/network.c b/toxcore/network.c index ca363efa..5e5160d8 100644 --- a/toxcore/network.c +++ b/toxcore/network.c | |||
@@ -433,13 +433,13 @@ static void loglogdata(const Logger *log, const char *message, const uint8_t *bu | |||
433 | int error = net_error(); | 433 | int error = net_error(); |
434 | const char *strerror = net_new_strerror(error); | 434 | const char *strerror = net_new_strerror(error); |
435 | LOGGER_TRACE(log, "[%2u] %s %3u%c %s:%u (%u: %s) | %04x%04x", | 435 | LOGGER_TRACE(log, "[%2u] %s %3u%c %s:%u (%u: %s) | %04x%04x", |
436 | buffer[0], message, (buflen < 999 ? buflen : 999), 'E', | 436 | buffer[0], message, min_u16(buflen, 999), 'E', |
437 | ip_ntoa(&ip_port.ip, ip_str, sizeof(ip_str)), net_ntohs(ip_port.port), error, | 437 | ip_ntoa(&ip_port.ip, ip_str, sizeof(ip_str)), net_ntohs(ip_port.port), error, |
438 | strerror, data_0(buflen, buffer), data_1(buflen, buffer)); | 438 | strerror, data_0(buflen, buffer), data_1(buflen, buffer)); |
439 | net_kill_strerror(strerror); | 439 | net_kill_strerror(strerror); |
440 | } else if ((res > 0) && ((size_t)res <= buflen)) { | 440 | } else if ((res > 0) && ((size_t)res <= buflen)) { |
441 | LOGGER_TRACE(log, "[%2u] %s %3u%c %s:%u (%u: %s) | %04x%04x", | 441 | LOGGER_TRACE(log, "[%2u] %s %3u%c %s:%u (%u: %s) | %04x%04x", |
442 | buffer[0], message, (res < 999 ? res : 999), ((size_t)res < buflen ? '<' : '='), | 442 | buffer[0], message, min_u16(res, 999), ((size_t)res < buflen ? '<' : '='), |
443 | ip_ntoa(&ip_port.ip, ip_str, sizeof(ip_str)), net_ntohs(ip_port.port), 0, "OK", | 443 | ip_ntoa(&ip_port.ip, ip_str, sizeof(ip_str)), net_ntohs(ip_port.port), 0, "OK", |
444 | data_0(buflen, buffer), data_1(buflen, buffer)); | 444 | data_0(buflen, buffer), data_1(buflen, buffer)); |
445 | } else { /* empty or overwrite */ | 445 | } else { /* empty or overwrite */ |