Hello everyone,

I am trying to use sprintf, but keep getting error: invalid use of void expression
Code:
sprintf(s,"%s",get_l());
The function get_l looks like:
Code:
void get_l()
{
	FILE *data;
	char buff[1024];
	data = popen("/usr/bin/whoami", "r");
        while(fread(buff, 1, sizeof(buff), data) > 0)
        {
           printf("%s",buff);
        }
        pclose(data);
}
If I just call the function in the main it works fine. Thanks in advance.
Brad