readline(): fix 5 implicit cast warnings

Michael
This commit is contained in:
Michael Adam 2009-08-07 10:10:04 +02:00
parent 947e8eb838
commit caee88c774

View File

@ -167,7 +167,8 @@ readline (int fd, char **whole_buffer)
};
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)
return -ENOMEM;
@ -180,7 +181,7 @@ readline (int fd, char **whole_buffer)
if (ret <= 0)
goto CLEANUP;
ptr = memchr (buffer, '\n', ret);
ptr = (char *)memchr (buffer, '\n', ret);
if (ptr)
diff = ptr - buffer + 1;
else
@ -198,7 +199,7 @@ readline (int fd, char **whole_buffer)
goto CLEANUP;
}
line_ptr->data = safemalloc (diff);
line_ptr->data = (char *)safemalloc (diff);
if (!line_ptr->data)
{
ret = -ENOMEM;
@ -214,7 +215,8 @@ readline (int fd, char **whole_buffer)
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)
{
ret = -ENOMEM;
@ -223,7 +225,7 @@ readline (int fd, char **whole_buffer)
line_ptr = line_ptr->next;
}
*whole_buffer = safemalloc (whole_buffer_len + 1);
*whole_buffer = (char *)safemalloc (whole_buffer_len + 1);
if (!*whole_buffer)
{
ret = -ENOMEM;