-/*
- * More client-side support functions.
- *
- * Copyright (c) 1987-2017 by the citadel.org team
- *
- * This program is open source software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+// More client-side support functions.
+//
+// Copyright (c) 1987-2017 by the citadel.org team
+//
+// This program is open source software. Use, duplication, and/or
+// disclosure are subject to the GNU General Purpose License version 3.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
#include "textclient.h"
-/* work around solaris include files */
+// work around solaris include files
#ifdef reg
#undef reg
#endif
extern int screenwidth;
-/*
- * return proper room prompt character
- */
-int room_prompt(unsigned int qrflags)
-{
+// return proper room prompt character
+int room_prompt(unsigned int qrflags) {
int a;
a = '>';
- if (qrflags & QR_DIRECTORY)
+ if (qrflags & QR_DIRECTORY) {
a = ']';
+ }
return (a);
}
-/*
- * Register with name and address
- */
-void entregis(CtdlIPC * ipc)
-{
+// Register with name and address
+void entregis(CtdlIPC * ipc) {
char buf[SIZ];
char tmpname[30];
remove_token(reg, 0, '\n');
if (a == 2)
- safestrncpy(tmpname, buf, sizeof tmpname);
+ strncpy(tmpname, buf, sizeof tmpname);
else if (a == 3)
- safestrncpy(tmpaddr, buf, sizeof tmpaddr);
+ strncpy(tmpaddr, buf, sizeof tmpaddr);
else if (a == 4)
- safestrncpy(tmpcity, buf, sizeof tmpcity);
+ strncpy(tmpcity, buf, sizeof tmpcity);
else if (a == 5)
- safestrncpy(tmpstate, buf, sizeof tmpstate);
+ strncpy(tmpstate, buf, sizeof tmpstate);
else if (a == 6)
- safestrncpy(tmpzip, buf, sizeof tmpzip);
+ strncpy(tmpzip, buf, sizeof tmpzip);
else if (a == 7)
- safestrncpy(tmpphone, buf, sizeof tmpphone);
+ strncpy(tmpphone, buf, sizeof tmpphone);
else if (a == 9)
- safestrncpy(tmpemail, buf, sizeof tmpemail);
+ strncpy(tmpemail, buf, sizeof tmpemail);
else if (a == 10)
- safestrncpy(tmpcountry, buf, sizeof tmpcountry);
+ strncpy(tmpcountry, buf, sizeof tmpcountry);
++a;
}
}
do {
ok = 1;
- safestrncpy(holdemail, tmpemail, sizeof holdemail);
+ strncpy(holdemail, tmpemail, sizeof holdemail);
strprompt("Email address", tmpemail, 31);
r = CtdlIPCDirectoryLookup(ipc, tmpemail, buf);
if (r / 100 == 2) {
scr_printf("\nYou can't use %s as your address.\n", tmpemail);
scr_printf("It is already in use by %s @ %s.\n", diruser, dirnode);
ok = 0;
- safestrncpy(tmpemail, holdemail, sizeof tmpemail);
+ strncpy(tmpemail, holdemail, sizeof tmpemail);
}
}
} while (ok == 0);
r = CtdlIPCImageUpload(ipc, 1, flnm, keyname, progress, buf);
if (r / 100 == 5) {
scr_printf("%s\n", buf);
- } else if (r < 0) {
+ }
+ else if (r < 0) {
scr_printf("Cannot upload '%s': %s\n", flnm, strerror(errno));
}
/* else upload succeeded */
execlp("rz", "rz", NULL);
exit(1);
}
- } else
- do {
- b = ka_wait(&a);
- } while ((b != xfer_pid) && (b != (-1)));
+ }
+ else do {
+ b = ka_wait(&a);
+ } while ((b != xfer_pid) && (b != (-1)));
stty_ctdl(0);
if (a != 0) {
nukedir(tempdir);
}
+
/*
* validate a user (returns 0 for successful validation, nonzero if quitting)
*/
} while (finished == 0);
}
+
void subshell(void)
{
int a, b;
}
-/*
- * read bio
- */
-void read_bio(CtdlIPC * ipc)
-{
+// read bio
+void read_bio(CtdlIPC * ipc) {
char who[256];
char buf[256];
char *resp = NULL;