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:
Jeffrey Cliff
2025-01-04 15:00:12 +01:00
committed by Alexander Naumov
parent 9142603b9f
commit 862cade38d

View File

@@ -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;