Fix gcc calloc() warning
gcc (GCC) 14.1.1 20240701 (Red Hat 14.1.1-7) produces this: network.c:159:57: warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and no t in the later argument [-Wcalloc-transposed-args] 159 | (struct read_lines_s *) safecalloc (sizeof (struct read_lines_s), | ^~~~~~ Fix them. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
This commit is contained in:
parent
05f6e4e000
commit
1801e5c552
@ -156,8 +156,7 @@ ssize_t readline (int fd, char **whole_buffer)
|
||||
struct read_lines_s *first_line, *line_ptr;
|
||||
|
||||
first_line =
|
||||
(struct read_lines_s *) safecalloc (sizeof (struct read_lines_s),
|
||||
1);
|
||||
(struct read_lines_s *) safecalloc (1, sizeof (struct read_lines_s));
|
||||
if (!first_line)
|
||||
return -ENOMEM;
|
||||
|
||||
@ -206,7 +205,7 @@ ssize_t readline (int fd, char **whole_buffer)
|
||||
|
||||
line_ptr->next =
|
||||
(struct read_lines_s *)
|
||||
safecalloc (sizeof (struct read_lines_s), 1);
|
||||
safecalloc (1, sizeof (struct read_lines_s));
|
||||
if (!line_ptr->next) {
|
||||
ret = -ENOMEM;
|
||||
goto CLEANUP;
|
||||
|
Loading…
Reference in New Issue
Block a user