* Fixed the urlesc() function to use a caller-supplied target buffer.
$Log$
+Revision 301.21 2001/12/20 05:02:42 ajc
+* If you paid for this software, someone is ripping you off.
+* Fixed the urlesc() function to use a caller-supplied target buffer.
+
Revision 301.20 2001/12/18 20:35:29 ajc
* More fun JavaScript-enabled buttons
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
-
wprintf("<CENTER><TABLE border><CAPTION>Select access level:");
wprintf("</CAPTION><TR>");
for (a = 0; a <= 6; ++a) {
- wprintf(
- "<TD><A HREF=\"/validate&user=%s&WC->axlevel=%d\">%s</A></TD>\n",
- urlesc(user), a, axdefs[a]);
+ wprintf("<TD><A HREF=\"/validate&user=");
+ urlescputs(user);
+ wprintf("&WC->axlevel=%d\">%s</A></TD>\n",
+ a, axdefs[a]);
}
wprintf("</TR></TABLE><CENTER><BR>\n");
wDumpContent(1);
serv_printf("GOTO %s", WC->wc_roomname);
serv_gets(buf);
if (buf[0] != '2') {
- /* ExpressMessageCat(&buf[4]); FIXME */
+ /* ExpressMessageCat(&buf[4]); */
} else {
serv_puts("FORG");
serv_gets(buf);
if (buf[0] != '2') {
- /* ExpressMessageCat(&buf[4]); FIXME */
+ /* ExpressMessageCat(&buf[4]); */
} else {
strcpy(final_destination, "_BASEROOM_");
}
/*
* Escape a string for feeding out as a URL.
- * FIXME ... not threadsafe!
+ * Returns a pointer to a buffer that must be freed by the caller!
*/
-char *urlesc(char *strbuf)
+void urlesc(char *outbuf, char *strbuf)
{
int a, b, c;
char *ec = " #&;`'|*?-~<>^()[]{}$\\";
- static char outbuf[SIZ];
strcpy(outbuf, "");
else
sprintf(&outbuf[b], "%c", strbuf[a]);
}
- return (outbuf);
}
void urlescputs(char *strbuf)
{
- wprintf("%s", urlesc(strbuf));
+ char outbuf[SIZ];
+
+ urlesc(outbuf, strbuf);
+ wprintf("%s", outbuf);
}
void wDumpContent(int);
void serv_printf(const char *format,...);
char *bstr(char *key);
-char *urlesc(char *);
+void urlesc(char *, char *);
void urlescputs(char *);
void output_headers(int);
void wprintf(const char *format,...);
}
/* Tell 'em who's in da house */
fprintf(stderr, SERVER "\n"
- "Copyright (C) 1996-2001\n"
- "This software is distributed under the terms of the GNU\n"
- "General Public License. All other rights reserved.\n\n");
+"Copyright (C) 1996-2001 by the Citadel/UX development team.\n"
+"This software is distributed under the terms of the GNU General Public\n"
+"License. If you paid for this software, someone is ripping you off.\n\n");
if (chdir(WEBCITDIR) != 0)
perror("chdir");