mirror of
https://git.savannah.gnu.org/git/screen.git
synced 2026-02-12 18:32:14 +02:00
fix: calloc call by swapping arg order
The prototype of calloc is void *calloc(size_t nmemb, size_t size); denoting "an array of nmemb objects, each of whose size is size." (C23) merely changing the order of arguments to put the size at the end (ie sizeof(char)) is what gcc seems to be looking for. It shouldn't affect anything other than this gcc warning, but it's good practice to use the API properly rather than backwards as well. bug #66417
This commit is contained in:
committed by
Alexander Naumov
parent
9142603b9f
commit
862cade38d
@@ -97,7 +97,7 @@ static int gl_License_row(ListData *ldata, ListRow *lrow)
|
||||
{
|
||||
(void)ldata; /* unused */
|
||||
|
||||
char *line = calloc(sizeof(char), flayer->l_width + 1);
|
||||
char *line = calloc(flayer->l_width + 1, sizeof(char));
|
||||
char *start = (char *)lrow->data;
|
||||
char *lastspace = start;
|
||||
size_t linelen = 0;
|
||||
|
||||
Reference in New Issue
Block a user