moved 'counter' variable to only be incremented when we've hit an actual record
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 28 Feb 2005 20:52:43 +0000 (20:52 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 28 Feb 2005 20:52:43 +0000 (20:52 +0000)
(and not just end of file, etc.)

git-svn-id: svn://svn.open-ils.org/ILS/trunk@148 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/extras/marcdumper/marcdumper.c

index 3c6ba4d..6c0faa7 100644 (file)
@@ -150,7 +150,6 @@ int main (int argc, char **argv) {
                                        yaz_marc_debug(mt, verbose);
 
                                        while (1) {
-                                               counter++;
                                                int len;
                                                char *result;
                                                int rlen;
@@ -183,6 +182,7 @@ int main (int argc, char **argv) {
                
 
 
+                                               counter++;
                                                if(!prune) {
 
                                                        fwrite (result, rlen, 1, stdout);
@@ -257,7 +257,7 @@ int main (int argc, char **argv) {
                exit (1);
        }
 
-       fprintf(stderr, "\nProcessed %d Records\n", counter - 1 );
+       fprintf(stderr, "\nProcessed %d Records\n", counter );
        exit (0);
 }