From: Felix Fietkau Date: Fri, 21 Mar 2014 20:11:39 +0000 (+0100) Subject: example: use stdout instead of stderr X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=32f153a8dba2ef26ec14dd2b4dff917fbda90f83;p=oweals%2Fuclient.git example: use stdout instead of stderr Signed-off-by: Felix Fietkau --- 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); } }