Commit 7605f1bd authored by Andreas Schwab's avatar Andreas Schwab
Browse files

(read_score): Fix type of second parameter

of getdelim to be of type size_t instead of int.  Use 0 instead of
ESUCCES.
parent 744ee133
2002-04-14 Andreas Schwab <schwab@suse.de>
* update-game-score.c (read_score): Fix type of second parameter
of getdelim to be of type size_t instead of int. Use 0 instead of
ESUCCES.
2002-04-10 Colin Walters <walters@verbum.org> 2002-04-10 Colin Walters <walters@verbum.org>
* update-game-score.c: (toplevel): Include stdarg.h. * update-game-score.c: (toplevel): Include stdarg.h.
......
...@@ -249,7 +249,7 @@ read_score(FILE *f, struct score_entry *score) ...@@ -249,7 +249,7 @@ read_score(FILE *f, struct score_entry *score)
ungetc(c, f); ungetc(c, f);
#ifdef HAVE_GETDELIM #ifdef HAVE_GETDELIM
{ {
int count = 0; size_t count = 0;
if (getdelim(&score->username, &count, ' ', f) < 1 if (getdelim(&score->username, &count, ' ', f) < 1
|| score->username == NULL) || score->username == NULL)
return -1; return -1;
...@@ -279,9 +279,9 @@ read_score(FILE *f, struct score_entry *score) ...@@ -279,9 +279,9 @@ read_score(FILE *f, struct score_entry *score)
#endif #endif
#ifdef HAVE_GETLINE #ifdef HAVE_GETLINE
score->data = NULL; score->data = NULL;
errno = ESUCCES; errno = 0;
{ {
int len; size_t len;
if (getline(&score->data, &len, f) < 0) if (getline(&score->data, &len, f) < 0)
return -1; return -1;
score->data[strlen(score->data)-1] = '\0'; score->data[strlen(score->data)-1] = '\0';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment