diff --git a/docs/examples/sepheaders.c b/docs/examples/sepheaders.c
index ead557214f1204840153e8cff701553b7224c8d4..40110ce951d24e5c3520fb9201c37c0fdf1630b9 100644
--- a/docs/examples/sepheaders.c
+++ b/docs/examples/sepheaders.c
@@ -19,9 +19,9 @@
 #include <curl/types.h>
 #include <curl/easy.h>
 
-size_t  write_data(void *ptr, size_t size, size_t nmemb, FILE *stream)
+size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream)
 {
-  written = fwrite(ptr,size,nmemb,outfile);
+  written = fwrite(ptr, size, nmemb, (FILE *)stream);
   return written;
 }