-/* Citadel/UX support routines */
-/* $Id$ */
+/*
+ * $Id$
+ *
+ * Client-side support functions.
+ *
+ */
#include "sysdep.h"
#include <stdlib.h>
#include <signal.h>
#include <dirent.h>
#include <errno.h>
-#include <time.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
#include <limits.h>
#ifdef HAVE_UTMP_H
#include <utmp.h>
sttybbs(1);
if (b==NEXT_KEY) sigcaught = SIGINT;
if (b==STOP_KEY) sigcaught = SIGQUIT;
- }
+}
/*
* change a user's access level
*/
void edituser(void)
{
- char buf[256];
- char who[256];
- char pass[256];
+ char buf[SIZ];
+ char who[SIZ];
+ char pass[SIZ];
int flags;
int timescalled;
int posted;
userpurge = extract_int(&buf[4], 8);
val_user(who, 0); /* Display registration */
- strprompt("Password", pass, 19);
+ if (boolprompt("Change password", 0)) {
+ strprompt("Password", pass, 19);
+ }
axlevel = intprompt("Access level", axlevel, 0, 6);
timescalled = intprompt("Times called", timescalled, 0, INT_MAX);
posted = intprompt("Messages posted", posted, 0, INT_MAX);
"Enable color support",US_COLOR);
}
- filter = intprompt("Moderation filter level", filter, -63, 63);
+ /* filter = intprompt("Moderation filter level", filter, -63, 63); */
}
void locate_host(char *hbuf)
{
#ifndef HAVE_UTMP_H
- char buf[256];
+ char buf[SIZ];
FILE *who;
int a,b;
strcpy(hbuf,serv_info.serv_fqdn);
return;
}
- fgets(buf,256,who);
+ fgets(buf,sizeof buf,who);
pclose(who);
b = 0;
* miscellaneous server commands (testing, etc.)
*/
void misc_server_cmd(char *cmd) {
- char buf[256];
+ char buf[SIZ];
serv_puts(cmd);
serv_gets(buf);
{
DIR *dp;
struct dirent *d;
- char filename[256];
+ char filename[SIZ];
dp = opendir(dirname);
if (dp == NULL) {