From 830fc26f5c91fa41c3371ae178cb14c36a2af611 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Thu, 25 Apr 2002 21:03:54 +0000 Subject: [PATCH] More small fixes for mbfido web --- ChangeLog | 2 ++ lib/faddr.c | 23 ++++++++++++++--------- mbfido/makestat.c | 4 +++- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2e5bac93..ef5cfe48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4617,6 +4617,8 @@ v0.33.20 10-Feb-2002 Added support for ext3 filesystem in diskspace check. Fixed lharc archives return code to LHA. Changed mkprod.awk script to support Debian Woody. + The aka2str function now onmits the @ if there is no domain + information. clcomm.a Added counter for mailer TCP/IP sessions. diff --git a/lib/faddr.c b/lib/faddr.c index ec12727f..a32b0907 100644 --- a/lib/faddr.c +++ b/lib/faddr.c @@ -1,11 +1,10 @@ /***************************************************************************** * - * File ..................: faddr.c + * $Id$ * Purpose ...............: Fidonet Address conversions. - * Last modification date : 18-Dec-1999 * ***************************************************************************** - * Copyright (C) 1993-1999 + * Copyright (C) 1993-2002 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -44,15 +43,21 @@ */ char *aka2str(fidoaddr aka) { - static char result[43]; + static char result[43]; - result[0] = '\0'; + result[0] = '\0'; + if (strlen(aka.domain)) { if (aka.point == 0) - sprintf(result, "%d:%d/%d@%s", aka.zone, aka.net, aka.node, aka.domain); + sprintf(result, "%d:%d/%d@%s", aka.zone, aka.net, aka.node, aka.domain); else - sprintf(result, "%d:%d/%d.%d@%s", aka.zone, aka.net, aka.node, aka.point, aka.domain); - - return result; + sprintf(result, "%d:%d/%d.%d@%s", aka.zone, aka.net, aka.node, aka.point, aka.domain); + } else { + if (aka.point == 0) + sprintf(result, "%d:%d/%d", aka.zone, aka.net, aka.node); + else + sprintf(result, "%d:%d/%d.%d", aka.zone, aka.net, aka.node, aka.point); + } + return result; } diff --git a/mbfido/makestat.c b/mbfido/makestat.c index 0e2c6f2f..ed3f7328 100644 --- a/mbfido/makestat.c +++ b/mbfido/makestat.c @@ -307,7 +307,9 @@ void MakeStat(void) fseek(fg, i * sizeof(hist), SEEK_SET); fread(&hist, sizeof(hist), 1, fg); fseek(fi, fileptr, SEEK_SET); - MacroVars("cdefghij", "sssssdds", aka2str(hist.aka), hist.system_name, hist.location, + if (!strcmp(hist.aka.domain, "(null)")) + hist.aka.domain[0] = '\0'; + MacroVars("cdefghij", "sssssdds", hist.aka.zone?aka2str(hist.aka):"N/A", hist.system_name, hist.location, adate(hist.online), t_elapsed(hist.online, hist.offline), hist.sent_bytes, hist.rcvd_bytes, hist.inbound ? "In":"Out"); MacroRead(fi, fw);