This commit is contained in:
Neale Pickett 2010-09-16 12:21:16 -06:00
parent 487893c314
commit 7305ae79cb
6 changed files with 9 additions and 6 deletions

View File

@ -1,4 +1,4 @@
CFLAGS = -Wall
CFLAGS = -Wall -Werror
TARGETS = in.tokend pointscli claim.cgi puzzler.cgi puzzles.cgi
all: build

View File

@ -1,4 +1,5 @@
#include <stdlib.h>
#include <ctype.h>
#include "common.h"
int

View File

@ -5,6 +5,7 @@
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <values.h>
#include <time.h>
@ -357,7 +358,6 @@ award_points(char const *teamhash,
int linelen;
char *filename;
int fd;
int ret;
time_t now = time(NULL);
if (! team_exists(teamhash)) {
@ -365,8 +365,8 @@ award_points(char const *teamhash,
}
linelen = snprintf(line, sizeof(line),
"%u %s %s %ld\n",
now, teamhash, category, points);
"%lu %s %s %ld\n",
(unsigned long)now, teamhash, category, points);
if (sizeof(line) <= linelen) {
return -1;
}
@ -428,7 +428,6 @@ award_and_log_uniquely(char const *team,
char const *line)
{
char *dbpath = srv_path(dbfile);
int ret;
int fd;
/* Make sure they haven't already claimed these points */

View File

@ -16,6 +16,7 @@ void cgi_error(char *fmt, ...);
int fgrepx(char const *needle, char const *filename);
int my_snprintf(char *buf, size_t buflen, char *fmt, ...);
char *srv_path(char const *fmt, ...);
int team_exists(char const *teamhash);
int award_points(char const *teamhacsh,

View File

@ -7,6 +7,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
#include <string.h>
#include <ctype.h>
#include "common.h"
#include "xxtea.h"
@ -117,7 +118,7 @@ main(int argc, char *argv[])
for (i = 0; i < itokenlen; i += 1) {
crap[i] = (uint8_t)random();
}
bubblebabble(digest, crap, itokenlen);
bubblebabble(digest, (char *)crap, itokenlen);
/* Append digest to service name. */
tokenlen = (size_t)my_snprintf(token, sizeof(token),

View File

@ -1,4 +1,5 @@
#include <stdlib.h>
#include <ctype.h>
#include "common.h"
int