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 TARGETS = in.tokend pointscli claim.cgi puzzler.cgi puzzles.cgi
all: build all: build

View File

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

View File

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

View File

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

View File

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