Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 017f138b authored by rswindell's avatar rswindell

Require numeric input before changing/clearing values.

parent cd5e1697
/* DSTSEDIT.C */
/* $Id$ */
/* Developed 1990-1997 by Rob Swindell; PO Box 501, Yorba Linda, CA 92885 */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2012 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
#include <stdio.h>
#include <sys/stat.h>
......@@ -51,7 +80,7 @@ main(int argc, char **argv)
}
close(file);
while (1) {
printf("Synchronet Daily Statistics Editor v1.01\r\n\r\n");
printf("Synchronet Daily Statistics Editor v1.02\r\n\r\n");
printf("S) %-25s: %13s\n", "Date Stamp (MM/DD/YY)", unixtodstr(&cfg, t, str));
printf(lst, 'L', "Total Logons", stats.logons);
printf(lst, 'O', "Logons Today", stats.ltoday);
......@@ -78,79 +107,79 @@ main(int argc, char **argv)
case 'S':
printf("Date stamp (MM/DD/YY): ");
fgets(str, sizeof(str), stdin);
if (str[0])
if (isdigit(str[0]))
t = dstrtounix(&cfg, str);
break;
case 'L':
printf(nv);
fgets(str, sizeof(str), stdin);
if (str[0])
if (isdigit(str[0]))
stats.logons = atol(str);
break;
case 'O':
printf(nv);
fgets(str, sizeof(str), stdin);
if (str[0])
if (isdigit(str[0]))
stats.ltoday = atol(str);
break;
case 'T':
printf(nv);
fgets(str, sizeof(str), stdin);
if (str[0])
if (isdigit(str[0]))
stats.timeon = atol(str);
break;
case 'I':
printf(nv);
fgets(str, sizeof(str), stdin);
if (str[0])
if (isdigit(str[0]))
stats.ttoday = atol(str);
break;
case 'U':
printf(nv);
fgets(str, sizeof(str), stdin);
if (str[0])
if (isdigit(str[0]))
stats.uls = atol(str);
break;
case 'B':
printf(nv);
fgets(str, sizeof(str), stdin);
if (str[0])
if (isdigit(str[0]))
stats.ulb = atol(str);
break;
case 'D':
printf(nv);
fgets(str, sizeof(str), stdin);
if (str[0])
if (isdigit(str[0]))
stats.dls = atol(str);
break;
case 'W':
printf(nv);
fgets(str, sizeof(str), stdin);
if (str[0])
if (isdigit(str[0]))
stats.dlb = atol(str);
break;
case 'P':
printf(nv);
fgets(str, sizeof(str), stdin);
if (str[0])
if (isdigit(str[0]))
stats.ptoday = atol(str);
break;
case 'E':
printf(nv);
fgets(str, sizeof(str), stdin);
if (str[0])
if (isdigit(str[0]))
stats.etoday = atol(str);
break;
case 'F':
printf(nv);
fgets(str, sizeof(str), stdin);
if (str[0])
if (isdigit(str[0]))
stats.ftoday = atol(str);
break;
case 'N':
printf(nv);
fgets(str, sizeof(str), stdin);
if (str[0])
if (isdigit(str[0]))
stats.nusers = atoi(str);
break;
case 'Q':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment