mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-14 20:33:48 +00:00
Fixed format compiler warnings
SVN revision: 831
This commit is contained in:
parent
e7efad7b9f
commit
f1b9c41916
31
src/elogd.c
31
src/elogd.c
@ -6,6 +6,9 @@
|
|||||||
Contents: Web server program for Electronic Logbook ELOG
|
Contents: Web server program for Electronic Logbook ELOG
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.297 2004/03/16 08:48:30 midas
|
||||||
|
Fixed format compiler warnings
|
||||||
|
|
||||||
Revision 1.296 2004/03/15 20:07:34 midas
|
Revision 1.296 2004/03/15 20:07:34 midas
|
||||||
Conditional attributes get evaluated correctly during editing of existing entries
|
Conditional attributes get evaluated correctly during editing of existing entries
|
||||||
|
|
||||||
@ -4891,7 +4894,7 @@ void set_redir(LOGBOOK * lbs, char *redir)
|
|||||||
|
|
||||||
void set_cookie(LOGBOOK * lbs, char *name, char *value, BOOL global, char *expiration)
|
void set_cookie(LOGBOOK * lbs, char *name, char *value, BOOL global, char *expiration)
|
||||||
{
|
{
|
||||||
char lb_name[256], str[NAME_LENGTH];
|
char lb_name[256], str[NAME_LENGTH], format[80];
|
||||||
double exp;
|
double exp;
|
||||||
time_t now;
|
time_t now;
|
||||||
struct tm *gmt;
|
struct tm *gmt;
|
||||||
@ -4939,7 +4942,8 @@ void set_cookie(LOGBOOK * lbs, char *name, char *value, BOOL global, char *expir
|
|||||||
time(&now);
|
time(&now);
|
||||||
now += (int) (3600 * exp);
|
now += (int) (3600 * exp);
|
||||||
gmt = gmtime(&now);
|
gmt = gmtime(&now);
|
||||||
strftime(str, sizeof(str), "%A, %d-%b-%y %H:%M:%S GMT", gmt);
|
strcpy(format, "%A, %d-%b-%y %H:%M:%S GMT");
|
||||||
|
strftime(str, sizeof(str), format, gmt);
|
||||||
|
|
||||||
rsprintf(" expires=%s;", str);
|
rsprintf(" expires=%s;", str);
|
||||||
}
|
}
|
||||||
@ -5734,7 +5738,7 @@ int exist_file(char *file_name)
|
|||||||
void send_file_direct(char *file_name)
|
void send_file_direct(char *file_name)
|
||||||
{
|
{
|
||||||
int fh, i, length, delta;
|
int fh, i, length, delta;
|
||||||
char str[MAX_PATH_LENGTH], charset[80];
|
char str[MAX_PATH_LENGTH], charset[80], format[80];
|
||||||
time_t now;
|
time_t now;
|
||||||
struct tm *gmt;
|
struct tm *gmt;
|
||||||
|
|
||||||
@ -5752,7 +5756,8 @@ void send_file_direct(char *file_name)
|
|||||||
time(&now);
|
time(&now);
|
||||||
now += (int) (3600 * 24);
|
now += (int) (3600 * 24);
|
||||||
gmt = gmtime(&now);
|
gmt = gmtime(&now);
|
||||||
strftime(str, sizeof(str), "%A, %d-%b-%y %H:%M:%S GMT", gmt);
|
strcpy(format, "%A, %d-%b-%y %H:%M:%S GMT");
|
||||||
|
strftime(str, sizeof(str), format, gmt);
|
||||||
rsprintf("Expires: %s\r\n", str);
|
rsprintf("Expires: %s\r\n", str);
|
||||||
|
|
||||||
if (use_keepalive) {
|
if (use_keepalive) {
|
||||||
@ -5937,7 +5942,7 @@ int build_subst_list(LOGBOOK * lbs, char list[][NAME_LENGTH], char value[][NAME_
|
|||||||
|
|
||||||
strftime(str, sizeof(str), format, ts);
|
strftime(str, sizeof(str), format, ts);
|
||||||
} else
|
} else
|
||||||
sprintf(str, "%d", now);
|
sprintf(str, "%d", (int)now);
|
||||||
|
|
||||||
strcpy(value[i++], str);
|
strcpy(value[i++], str);
|
||||||
|
|
||||||
@ -11716,7 +11721,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
*list, *text, *text1, *text2, in_reply_to[80], reply_to[MAX_REPLY_TO * 10],
|
*list, *text, *text1, *text2, in_reply_to[80], reply_to[MAX_REPLY_TO * 10],
|
||||||
attachment[MAX_ATTACHMENTS][MAX_PATH_LENGTH], encoding[80], locked_by[256],
|
attachment[MAX_ATTACHMENTS][MAX_PATH_LENGTH], encoding[80], locked_by[256],
|
||||||
str[NAME_LENGTH], ref[256], img[80], comment[NAME_LENGTH], mode[80], mid[80],
|
str[NAME_LENGTH], ref[256], img[80], comment[NAME_LENGTH], mode[80], mid[80],
|
||||||
menu_str[1000], menu_item[MAX_N_LIST][NAME_LENGTH], param[NAME_LENGTH];
|
menu_str[1000], menu_item[MAX_N_LIST][NAME_LENGTH], param[NAME_LENGTH], format[80];
|
||||||
char *p, *pt, *pt1, *pt2, *slist, *svalue, *gattr;
|
char *p, *pt, *pt1, *pt2, *slist, *svalue, *gattr;
|
||||||
BOOL show_attachments, threaded, csv, mode_commands, expand, filtering, disp_filter,
|
BOOL show_attachments, threaded, csv, mode_commands, expand, filtering, disp_filter,
|
||||||
show_text;
|
show_text;
|
||||||
@ -12002,6 +12007,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
/*---- filter message list ----*/
|
/*---- filter message list ----*/
|
||||||
|
|
||||||
filtering = FALSE;
|
filtering = FALSE;
|
||||||
|
show_text = TRUE;
|
||||||
|
|
||||||
for (i = 0; i < lbs->n_attr; i++) {
|
for (i = 0; i < lbs->n_attr; i++) {
|
||||||
/* check if attribute filter */
|
/* check if attribute filter */
|
||||||
@ -12504,7 +12510,8 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
if (tms.tm_year < 90)
|
if (tms.tm_year < 90)
|
||||||
tms.tm_year += 100;
|
tms.tm_year += 100;
|
||||||
mktime(&tms);
|
mktime(&tms);
|
||||||
strftime(str, sizeof(str), "%x", &tms);
|
strcpy(format, "%x");
|
||||||
|
strftime(str, sizeof(str), format, &tms);
|
||||||
|
|
||||||
rsprintf("<tr><td nowrap width=\"10%%\" class=\"attribname\">%s:</td>",
|
rsprintf("<tr><td nowrap width=\"10%%\" class=\"attribname\">%s:</td>",
|
||||||
loc("Start date"));
|
loc("Start date"));
|
||||||
@ -12523,7 +12530,8 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
ltime = mktime(&tms);
|
ltime = mktime(&tms);
|
||||||
ltime -= 3600 * 24;
|
ltime -= 3600 * 24;
|
||||||
memcpy(&tms, localtime(<ime), sizeof(struct tm));
|
memcpy(&tms, localtime(<ime), sizeof(struct tm));
|
||||||
strftime(str, sizeof(str), "%x", &tms);
|
strcpy(format, "%x");
|
||||||
|
strftime(str, sizeof(str), format, &tms);
|
||||||
|
|
||||||
rsprintf("<tr><td nowrap width=\"10%%\" class=\"attribname\">%s:</td>",
|
rsprintf("<tr><td nowrap width=\"10%%\" class=\"attribname\">%s:</td>",
|
||||||
loc("End date"));
|
loc("End date"));
|
||||||
@ -12545,7 +12553,8 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
rsprintf("<td class=\"attribvalue\">");
|
rsprintf("<td class=\"attribvalue\">");
|
||||||
if (ltime1) {
|
if (ltime1) {
|
||||||
memcpy(&tms, localtime(<ime1), sizeof(struct tm));
|
memcpy(&tms, localtime(<ime1), sizeof(struct tm));
|
||||||
strftime(str, sizeof(str), "%x", &tms);
|
strcpy(format, "%x");
|
||||||
|
strftime(str, sizeof(str), format, &tms);
|
||||||
if (ltime2 > 0)
|
if (ltime2 > 0)
|
||||||
rsprintf("%s %s", loc("From"), str);
|
rsprintf("%s %s", loc("From"), str);
|
||||||
else
|
else
|
||||||
@ -12553,7 +12562,8 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
}
|
}
|
||||||
if (ltime2) {
|
if (ltime2) {
|
||||||
memcpy(&tms, localtime(<ime2), sizeof(struct tm));
|
memcpy(&tms, localtime(<ime2), sizeof(struct tm));
|
||||||
strftime(str, sizeof(str), "%x", &tms);
|
strcpy(format, "%x");
|
||||||
|
strftime(str, sizeof(str), format, &tms);
|
||||||
if (ltime1 > 0)
|
if (ltime1 > 0)
|
||||||
rsprintf(" %s %s", loc("to"), str);
|
rsprintf(" %s %s", loc("to"), str);
|
||||||
else
|
else
|
||||||
@ -12648,7 +12658,6 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* evaluate Guest display list */
|
/* evaluate Guest display list */
|
||||||
show_text = TRUE;
|
|
||||||
if (getcfg(lbs->name, "Password file", str) &&
|
if (getcfg(lbs->name, "Password file", str) &&
|
||||||
getcfg(lbs->name, "Guest display", str) &&
|
getcfg(lbs->name, "Guest display", str) &&
|
||||||
!isparam("unm")) {
|
!isparam("unm")) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user