readline(): fix 5 implicit cast warnings
Michael
This commit is contained in:
parent
947e8eb838
commit
caee88c774
@ -167,7 +167,8 @@ readline (int fd, char **whole_buffer)
|
|||||||
};
|
};
|
||||||
struct read_lines_s *first_line, *line_ptr;
|
struct read_lines_s *first_line, *line_ptr;
|
||||||
|
|
||||||
first_line = safecalloc (sizeof (struct read_lines_s), 1);
|
first_line = (struct read_lines_s *)safecalloc (sizeof (struct read_lines_s),
|
||||||
|
1);
|
||||||
if (!first_line)
|
if (!first_line)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
@ -180,7 +181,7 @@ readline (int fd, char **whole_buffer)
|
|||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
goto CLEANUP;
|
goto CLEANUP;
|
||||||
|
|
||||||
ptr = memchr (buffer, '\n', ret);
|
ptr = (char *)memchr (buffer, '\n', ret);
|
||||||
if (ptr)
|
if (ptr)
|
||||||
diff = ptr - buffer + 1;
|
diff = ptr - buffer + 1;
|
||||||
else
|
else
|
||||||
@ -198,7 +199,7 @@ readline (int fd, char **whole_buffer)
|
|||||||
goto CLEANUP;
|
goto CLEANUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
line_ptr->data = safemalloc (diff);
|
line_ptr->data = (char *)safemalloc (diff);
|
||||||
if (!line_ptr->data)
|
if (!line_ptr->data)
|
||||||
{
|
{
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
@ -214,7 +215,8 @@ readline (int fd, char **whole_buffer)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
line_ptr->next = safecalloc (sizeof (struct read_lines_s), 1);
|
line_ptr->next =
|
||||||
|
(struct read_lines_s *)safecalloc (sizeof (struct read_lines_s), 1);
|
||||||
if (!line_ptr->next)
|
if (!line_ptr->next)
|
||||||
{
|
{
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
@ -223,7 +225,7 @@ readline (int fd, char **whole_buffer)
|
|||||||
line_ptr = line_ptr->next;
|
line_ptr = line_ptr->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
*whole_buffer = safemalloc (whole_buffer_len + 1);
|
*whole_buffer = (char *)safemalloc (whole_buffer_len + 1);
|
||||||
if (!*whole_buffer)
|
if (!*whole_buffer)
|
||||||
{
|
{
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
|
Loading…
Reference in New Issue
Block a user