$Id$
+Sun Nov 27 21:28:03 EST 2005 ajc
+* Eliminated the use of tmpnam() to shut up compiler warnings.
+
Sun Nov 27 18:42:15 CET 2005 dothebart
* Detect locale from Browser Environment
int i;
#endif
char buf[SIZ];
- char *dialog_result;
+ char dialog_result[PATH_MAX];
char setupmsg[SIZ];
FILE *fp;
break;
case UI_DIALOG:
- dialog_result = tmpnam(NULL);
+ CtdlMakeTempFileName(dialog_result, sizeof dialog_result);
sprintf(buf, "exec %s --backtitle '%s' --inputbox '%s' 19 72 '%s' 2>%s",
getenv("CTDL_DIALOG"),
"WebCit setup",
(seq++)
);
}
+
+
+/*
+ * Local replacement for controversial C library function that generates
+ * names for temporary files. Included to shut up compiler warnings.
+ */
+void CtdlMakeTempFileName(char *name, int len) {
+ int i = 0;
+
+ while (i++, i < 100) {
+ snprintf(name, len, "/tmp/ctdl.%04x.%04x",
+ getpid(),
+ rand()
+ );
+ if (!access(name, F_OK)) {
+ return;
+ }
+ }
+}
void display_inetconf(void);
void save_inetconf(void);
void generate_uuid(char *);
+void CtdlMakeTempFileName(char *, int);
void display_preferences(void);
void set_preferences(void);
void recp_autocomplete(char *);