[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lib-src/update-game-score.c
From: |
Colin Walters |
Subject: |
[Emacs-diffs] Changes to emacs/lib-src/update-game-score.c |
Date: |
Fri, 05 Apr 2002 04:18:59 -0500 |
Index: emacs/lib-src/update-game-score.c
diff -c emacs/lib-src/update-game-score.c:1.2
emacs/lib-src/update-game-score.c:1.3
*** emacs/lib-src/update-game-score.c:1.2 Fri Apr 5 03:53:37 2002
--- emacs/lib-src/update-game-score.c Fri Apr 5 04:18:57 2002
***************
*** 189,194 ****
--- 189,195 ----
;
if (c == EOF)
return -1;
+ ungetc(c, f);
#ifdef HAVE_GETDELIM
{
int count = 0;
***************
*** 200,206 ****
{
int unameread = 0;
int unamelen = 30;
! char *username;
while ((c = getc(f)) != EOF
&& !isspace(c))
--- 201,209 ----
{
int unameread = 0;
int unamelen = 30;
! char *username = malloc(unamelen);
! if (!username)
! return -1;
while ((c = getc(f)) != EOF
&& !isspace(c))
***************
*** 213,218 ****
--- 216,224 ----
username[unameread] = c;
unameread++;
}
+ if (c == EOF)
+ return -1;
+ username[unameread] = '\0';
score->username = username;
}
#endif
***************
*** 231,237 ****
char *buf = malloc(len);
if (!buf)
return -1;
! while ((c = getc(f)) != EOF)
{
if (cur >= len-1)
{
--- 237,244 ----
char *buf = malloc(len);
if (!buf)
return -1;
! while ((c = getc(f)) != EOF
! && c != '\n')
{
if (cur >= len-1)
{
***************
*** 242,248 ****
cur++;
}
score->data = buf;
- score->data[cur+1] = '\0';
}
#endif
/* Trim the newline */
--- 249,254 ----
- [Emacs-diffs] Changes to emacs/lib-src/update-game-score.c, Colin Walters, 2002/04/05
- [Emacs-diffs] Changes to emacs/lib-src/update-game-score.c,
Colin Walters <=
- [Emacs-diffs] Changes to emacs/lib-src/update-game-score.c, Colin Walters, 2002/04/07
- [Emacs-diffs] Changes to emacs/lib-src/update-game-score.c, Colin Walters, 2002/04/10
- [Emacs-diffs] Changes to emacs/lib-src/update-game-score.c, Andreas Schwab, 2002/04/13
- [Emacs-diffs] Changes to emacs/lib-src/update-game-score.c, Colin Walters, 2002/04/14
- [Emacs-diffs] Changes to emacs/lib-src/update-game-score.c, Eli Zaretskii, 2002/04/16
- [Emacs-diffs] Changes to emacs/lib-src/update-game-score.c, Colin Walters, 2002/04/23
- [Emacs-diffs] Changes to emacs/lib-src/update-game-score.c, Colin Walters, 2002/04/29