64bit-portability-issue

package https://build.opensuse.org/package/show?package=mosaic&project=home:etamPL:testing

I get error:

E: mosaic 64bit-portability-issue HTInit.c:556

HTInit.c:556

while(!(getline(l,MAX_STRING_LEN,f)))

where variables are:

#define MAX_STRING_LEN 256
char l[MAX_STRING_LEN];
FILE *f;

getline is defined in stdio.h

Do you have any idea how to solve that?

Try:

#define MAX_STRING_LEN (size_t)256

http://kenfrost.0catch.com/computer.JPG

:wink:

Really. Still the same.

The second parameter to getline is a pointer to a variable of type size_t. So, you have to make it an address:

size_t len = MAX_STRING_LEN;
...
while(!(getline(l, &len, f)))

Also, it is wrong to pass char array (memory is not allocated through malloc or calloc) as the first parameter because getline may call realloc if char buffer length is not enough.

Thanks. That works.