In a Linux C program, I call
FILE *fd = popen("curl ipecho.net/plain", "r");
fgets(buffer, BUFFER_CONTENTS_MAX, fd);
pclose(fd);
to store my machine's IP address into a buffer, and it returns just the IP address (plus some other stuff which I strip off). It works fine, but during the call, CURL echoes a header to stdout despite the "/plain" switch. How can I suppress the stdout output? The unwanted output winds up looking like:
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 11 100 11 0 0 86 0 --:--:-- --:--:-- --:--:-- 85