]> git.sur5r.net Git - openldap/commitdiff
Cleanup prev commit
authorHoward Chu <hyc@openldap.org>
Fri, 11 Apr 2008 12:20:01 +0000 (12:20 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 11 Apr 2008 12:20:01 +0000 (12:20 +0000)
servers/slapd/slapcat.c

index b8da193d30f96cf205d8ab27a4f7a0d935c51900..6ea1952006502541080756408981bf00ea2f8039 100644 (file)
@@ -84,7 +84,6 @@ slapcat( int argc, char **argv )
                char *data;
                int len;
                Entry* e;
-               int writerc;
 
                if ( gotsig )
                        break;
@@ -124,16 +123,8 @@ slapcat( int argc, char **argv )
                        break;
                }
 
-               writerc = fputs( data, ldiffp->fp );
-               if ( writerc == EOF ) {
-                       fprintf(stderr, "%s: error writing output.\n",
-                               progname);
-                       rc = EXIT_FAILURE;
-                       break;
-               }
-
-               writerc = fputs( "\n", ldiffp->fp );
-               if ( writerc == EOF ) {
+               if ( fputs( data, ldiffp->fp ) == EOF ||
+                       fputs( "\n", ldiffp->fp ) == EOF ) {
                        fprintf(stderr, "%s: error writing output.\n",
                                progname);
                        rc = EXIT_FAILURE;