X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fcpydata.c;h=048579ebe61db5c6538952e7d687e761dd28ea5d;hb=4c0c2fb7766546cb466f05f76e5febd5d8f682e0;hp=d322ba9b3ed021d19dd37afdfeb34f9833fa1547;hpb=5dd6771b28c257af405d7248639ed0e3bcdce38b;p=mmh diff --git a/sbr/cpydata.c b/sbr/cpydata.c index d322ba9..048579e 100644 --- a/sbr/cpydata.c +++ b/sbr/cpydata.c @@ -1,25 +1,24 @@ - /* - * cpydata.c -- copy all data from one fd to another - * - * This code is Copyright (c) 2002, by the authors of nmh. See the - * COPYRIGHT file in the root directory of the nmh distribution for - * complete copyright information. - */ +** cpydata.c -- copy all data from one fd to another +** +** This code is Copyright (c) 2002, by the authors of nmh. See the +** COPYRIGHT file in the root directory of the nmh distribution for +** complete copyright information. +*/ #include void -cpydata (int in, int out, char *ifile, char *ofile) +cpydata(int in, int out, char *ifile, char *ofile) { - int i; - char buffer[BUFSIZ]; + int i; + char buffer[BUFSIZ]; - while ((i = read(in, buffer, sizeof(buffer))) > 0) { - if (write(out, buffer, i) != i) - adios(ofile, "error writing"); - } + while ((i = read(in, buffer, sizeof(buffer))) > 0) { + if (write(out, buffer, i) != i) + adios(ofile, "error writing"); + } - if (i == -1) - adios(ifile, "error reading"); + if (i == -1) + adios(ifile, "error reading"); }