AmendHub

jcs

/

subtext

/

amendments

/

420

fidopkt: Tweak log messages


jcs made amendment 420 11 months ago
--- fidopkt.c Tue Mar 14 10:16:10 2023 +++ fidopkt.c Wed Mar 15 13:59:07 2023 @@ -211,12 +211,12 @@ fidopkt_parse_message(char *packet_filename, struct fi if (header == NULL) { if (len < FIDOPKT_HEADER_SIZE) { - logger_printf("[fidopkt] packet too small (%ld)", len); + logger_printf("[fidopkt] Packet too small (%ld)", len); return; } if (GET_U16(buf + FIDOPKT_PKTTYPE) != 2) { - logger_printf("[fidopkt] not a FidoNet packet"); + logger_printf("[fidopkt] Not a FidoNet packet"); return; } @@ -227,7 +227,7 @@ fidopkt_parse_message(char *packet_filename, struct fi if (buf[FIDOPKT_CWVALIDCOPY] != buf[FIDOPKT_CAPABILWORD + 1] || buf[FIDOPKT_CWVALIDCOPY + 1] != buf[FIDOPKT_CAPABILWORD]) { - logger_printf("[fidopkt] not in 4d format"); + logger_printf("[fidopkt] Not in 4d format"); return; } @@ -254,12 +254,12 @@ fidopkt_parse_message(char *packet_filename, struct fi } if (len < FIDOPKT_MSG_HEADER_SIZE) { - logger_printf("[fidopkt] message header too short"); + logger_printf("[fidopkt] Message header too short"); return; } if (GET_U16(buf + FIDOPKT_MSG_PKTTYPE) != 2) { - logger_printf("[fidopkt] header packet type != 2"); + logger_printf("[fidopkt] Header packet type != 2"); return; } @@ -270,7 +270,8 @@ fidopkt_parse_message(char *packet_filename, struct fi ret = xmalloczero(sizeof(struct fidopkt_message)); if (ret == NULL) { - logger_printf("[fidopkt] malloc failed"); + logger_printf("[fidopkt] malloc(%lu) failed", + sizeof(struct fidopkt_message)); goto parse_fail; } @@ -284,12 +285,12 @@ fidopkt_parse_message(char *packet_filename, struct fi fidopkt_read_until(&buf, &len, '\0', sizeof(line), line, true); if (len == 0) { - logger_printf("[fidopkt] short read"); + logger_printf("[fidopkt] Short read"); goto parse_fail; } if (sscanf(line, "%d %5s %d %d:%d:%d", &dday, (char *)&dmon, &dyear, &dhour, &dmin, &dsec) != 6) { - logger_printf("[fidopkt] couldn't parse date \"%s\"", line); + logger_printf("[fidopkt] Couldn't parse date \"%s\"", line); goto parse_fail; } @@ -307,7 +308,7 @@ fidopkt_parse_message(char *packet_filename, struct fi } } if (tm.tm_mon == -1) { - logger_printf("[fidopkt] couldn't parse month \"%s\"", dmon); + logger_printf("[fidopkt] Couldn't parse month \"%s\"", dmon); goto parse_fail; } #ifdef FIDOPKT_DEBUG @@ -316,18 +317,18 @@ fidopkt_parse_message(char *packet_filename, struct fi fidopkt_read_until(&buf, &len, '\0', sizeof(ret->to), ret->to, true); if (len == 0) { - logger_printf("[fidopkt] short read to"); + logger_printf("[fidopkt] Short read during \"to\""); goto parse_fail; } fidopkt_read_until(&buf, &len, '\0', sizeof(ret->from), ret->from, true); if (len == 0) { - logger_printf("[fidopkt] short read from"); + logger_printf("[fidopkt] Short read during \"from\""); goto parse_fail; } fidopkt_read_until(&buf, &len, '\0', sizeof(ret->subject), ret->subject, true); if (len == 0) { - logger_printf("[fidopkt] short read subject"); + logger_printf("[fidopkt] Short read during \"subject\""); goto parse_fail; } @@ -420,7 +421,7 @@ fidopkt_parse_message(char *packet_filename, struct fi ret->time = mktime(&tm); if (ret->time == -1) { - logger_printf("[fidopkt] parsed date but mktime failed"); + logger_printf("[fidopkt] Parsed date but mktime failed"); goto parse_fail; } /* make time UTC */ @@ -436,7 +437,7 @@ fidopkt_parse_message(char *packet_filename, struct fi } if (!fidopkt_parse_msgid(ret)) { - logger_printf("[fidopkt] failed parsing msgid \"%s\"", + logger_printf("[fidopkt] Failed parsing msgid \"%s\"", ret->msgid_orig); goto parse_fail; }