mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
read_string: Use char if you mean char.
This commit is contained in:
parent
df072c3b2b
commit
ca93b4a299
@ -4498,16 +4498,16 @@ time_t get8ctime(FILE *fd)
|
|||||||
/// @return pointer to the string or NULL when unable to read that many bytes.
|
/// @return pointer to the string or NULL when unable to read that many bytes.
|
||||||
char *read_string(FILE *fd, size_t cnt)
|
char *read_string(FILE *fd, size_t cnt)
|
||||||
{
|
{
|
||||||
uint8_t *str = xmallocz(cnt);
|
char *str = xmallocz(cnt);
|
||||||
for (size_t i = 0; i < cnt; i++) {
|
for (size_t i = 0; i < cnt; i++) {
|
||||||
int c = getc(fd);
|
int c = getc(fd);
|
||||||
if (c == EOF) {
|
if (c == EOF) {
|
||||||
xfree(str);
|
xfree(str);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
str[i] = (uint8_t)c;
|
str[i] = (char)c;
|
||||||
}
|
}
|
||||||
return (char *)str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Writes a number to file "fd", most significant bit first, in "len" bytes.
|
/// Writes a number to file "fd", most significant bit first, in "len" bytes.
|
||||||
|
Loading…
Reference in New Issue
Block a user