From d0e3b7be5a5f79e52a6469c3480b288213580a02 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 26 Feb 2014 10:33:17 +0100 Subject: move output of CGI header down --- cqrlogo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cqrlogo.c b/cqrlogo.c index 6153cb7..a822c6d 100644 --- a/cqrlogo.c +++ b/cqrlogo.c @@ -94,15 +94,15 @@ int main(int argc, char **argv) { } } - /* print HTTP header */ - printf("Content-Type: image/png\n\n"); - /* generate PNG data */ if ((png = generate_png(bitmap, CQR_COMMENT|CQR_REFERER|CQR_VERSION|CQR_LIBVERSION, uri)) == NULL) { fprintf(stderr, "Failed to generate PNG.\n"); return EXIT_FAILURE; } + /* print HTTP header */ + printf("Content-Type: image/png\n\n"); + /* write PNG data to stdout */ if (fwrite(png->buffer, png->size, 1, stdout) != 1) { fprintf(stderr, "Failed writing PNG data to stdout.\n"); -- cgit v1.2.3-70-g09d2