From 32f153a8dba2ef26ec14dd2b4dff917fbda90f83 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 21 Mar 2014 21:11:39 +0100 Subject: [PATCH] example: use stdout instead of stderr Signed-off-by: Felix Fietkau --- uclient-example.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/uclient-example.c b/uclient-example.c index b66468a..07b330d 100644 --- a/uclient-example.c +++ b/uclient-example.c @@ -1,4 +1,6 @@ #include +#include +#include #include "uclient.h" @@ -7,12 +9,12 @@ static void example_header_done(struct uclient *cl) struct blob_attr *cur; int rem; - fprintf(stderr, "Headers: \n"); + printf("Headers: \n"); blobmsg_for_each_attr(cur, cl->meta, rem) { - fprintf(stderr, "%s=%s\n", blobmsg_name(cur), (char *) blobmsg_data(cur)); + printf("%s=%s\n", blobmsg_name(cur), (char *) blobmsg_data(cur)); } - fprintf(stderr, "Contents:\n"); + printf("Contents:\n"); } static void example_read_data(struct uclient *cl) @@ -25,7 +27,7 @@ static void example_read_data(struct uclient *cl) if (!len) return; - fwrite(buf, len, 1, stderr); + write(STDOUT_FILENO, buf, len); } } -- 2.25.1