Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
f5bceaf8
Commit
f5bceaf8
authored
Apr 05, 2002
by
Colin Walters
Browse files
Actually make previous changes work (oops).
parent
cd553ffb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
lib-src/update-game-score.c
lib-src/update-game-score.c
+9
-3
No files found.
lib-src/update-game-score.c
View file @
f5bceaf8
...
...
@@ -189,6 +189,7 @@ read_score(FILE *f, struct score_entry *score)
;
if
(
c
==
EOF
)
return
-
1
;
ungetc
(
c
,
f
);
#ifdef HAVE_GETDELIM
{
int
count
=
0
;
...
...
@@ -200,7 +201,9 @@ read_score(FILE *f, struct score_entry *score)
{
int
unameread
=
0
;
int
unamelen
=
30
;
char
*
username
;
char
*
username
=
malloc
(
unamelen
);
if
(
!
username
)
return
-
1
;
while
((
c
=
getc
(
f
))
!=
EOF
&&
!
isspace
(
c
))
...
...
@@ -213,6 +216,9 @@ read_score(FILE *f, struct score_entry *score)
username
[
unameread
]
=
c
;
unameread
++
;
}
if
(
c
==
EOF
)
return
-
1
;
username
[
unameread
]
=
'\0'
;
score
->
username
=
username
;
}
#endif
...
...
@@ -231,7 +237,8 @@ read_score(FILE *f, struct score_entry *score)
char
*
buf
=
malloc
(
len
);
if
(
!
buf
)
return
-
1
;
while
((
c
=
getc
(
f
))
!=
EOF
)
while
((
c
=
getc
(
f
))
!=
EOF
&&
c
!=
'\n'
)
{
if
(
cur
>=
len
-
1
)
{
...
...
@@ -242,7 +249,6 @@ read_score(FILE *f, struct score_entry *score)
cur
++
;
}
score
->
data
=
buf
;
score
->
data
[
cur
+
1
]
=
'\0'
;
}
#endif
/* Trim the newline */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment