X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Fdoc%2Fchew.c;h=5622ff2c668db155c106702667bc3f3d9ca207c7;hb=c067354b06cc372b318bbbc5ee5098ec6ef87bc1;hp=aea0420de422971d1199a30555346390b08e4212;hpb=3e110533652d0f94211681ab718b7471f8bd3493;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/doc/chew.c b/bfd/doc/chew.c index aea0420de4..5622ff2c66 100644 --- a/bfd/doc/chew.c +++ b/bfd/doc/chew.c @@ -1,24 +1,25 @@ /* chew Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, - 2002, 2003, 2005 + 2002, 2003, 2005, 2007 Free Software Foundation, Inc. Contributed by steve chamberlain @cygnus -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ /* Yet another way of extracting documentation from source. No, I haven't finished it yet, but I hope you people like it better @@ -83,10 +84,11 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. Foo. */ #include "ansidecl.h" -#include "sysdep.h" #include #include #include +#include +#include #define DEF_SIZE 5000 #define STACK 50 @@ -118,6 +120,7 @@ static void overwrite_string (string_type *, string_type *); static void catbuf (string_type *, char *, unsigned int); static void cattext (string_type *, char *); static void catstr (string_type *, string_type *); +static void die (char *); #endif static void @@ -160,7 +163,9 @@ write_buffer (buffer, f) string_type *buffer; FILE *f; { - fwrite (buffer->ptr, buffer->write_idx, 1, f); + if (buffer->write_idx != 0 + && fwrite (buffer->ptr, buffer->write_idx, 1, f) != 1) + die ("cannot write output"); } static void