Do not mix buffered output and unbuffured output (printf and write).
authorThadeu Lima de Souza Cascardo <cascardo@minaslivre.org>
Sun, 27 Jan 2008 04:15:57 +0000 (02:15 -0200)
committerThadeu Lima de Souza Cascardo <cascardo@minaslivre.org>
Sun, 27 Jan 2008 04:15:57 +0000 (02:15 -0200)
frontend/cgi/cgi.c

index 84481b9..d3dbbf5 100644 (file)
@@ -42,8 +42,9 @@ cgi_serve_request (AtomCtx *ctx)
       iri_delete (iri);
       if (atom)
        {
-         fprintf (stdout, "Content-Type: application/atom+xml\n\n");
-         write (stdout, atom_string (atom), atom_len (atom));
+         char *header = "Content-type: application/atom+xml\n\n";
+         write (1, header, strlen (header));
+         write (1, atom_string (atom), atom_len (atom));
          atom_delete (atom);
        }
     }