summaryrefslogtreecommitdiff
path: root/tests/lib/test_buffer.c
diff options
context:
space:
mode:
authorwhitespace / reindent <invalid@invalid.invalid>2017-08-09 11:49:42 +0200
committerwhitespace / reindent <invalid@invalid.invalid>2017-08-09 12:03:17 +0200
commitac4d0be5874fafd14212d6007fff7495edc9b152 (patch)
tree5e2f0d3189de928c849f9983406389ade3b098cb /tests/lib/test_buffer.c
parent76a86854181c27819e5cf71b12ae1fa5ccd9e02a (diff)
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'tests/lib/test_buffer.c')
-rw-r--r--tests/lib/test_buffer.c58
1 files changed, 28 insertions, 30 deletions
diff --git a/tests/lib/test_buffer.c b/tests/lib/test_buffer.c
index 67e4035806..7e124c1f56 100644
--- a/tests/lib/test_buffer.c
+++ b/tests/lib/test_buffer.c
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2004 Paul Jakma
*
* This file is part of Quagga.
@@ -16,7 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with Quagga; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * 02111-1307, USA.
*/
#include <zebra.h>
@@ -26,35 +26,33 @@
struct thread_master *master;
-int
-main(int argc, char **argv)
+int main(int argc, char **argv)
{
- struct buffer *b1, *b2;
- int n;
- char junk[3];
- char c = 'a';
+ struct buffer *b1, *b2;
+ int n;
+ char junk[3];
+ char c = 'a';
- memory_init();
-
- if ((argc != 2) || (sscanf(argv[1], "%d%1s", &n, junk) != 1))
- {
- fprintf(stderr, "Usage: %s <number of chars to simulate>\n", *argv);
- return 1;
- }
+ memory_init();
- b1 = buffer_new(0);
- b2 = buffer_new(1024);
-
- while (n-- > 0)
- {
- buffer_put(b1, &c, 1);
- buffer_put(b2, &c, 1);
- if (c++ == 'z')
- c = 'a';
- buffer_reset(b1);
- buffer_reset(b2);
- }
- buffer_free(b1);
- buffer_free(b2);
- return 0;
+ if ((argc != 2) || (sscanf(argv[1], "%d%1s", &n, junk) != 1)) {
+ fprintf(stderr, "Usage: %s <number of chars to simulate>\n",
+ *argv);
+ return 1;
+ }
+
+ b1 = buffer_new(0);
+ b2 = buffer_new(1024);
+
+ while (n-- > 0) {
+ buffer_put(b1, &c, 1);
+ buffer_put(b2, &c, 1);
+ if (c++ == 'z')
+ c = 'a';
+ buffer_reset(b1);
+ buffer_reset(b2);
+ }
+ buffer_free(b1);
+ buffer_free(b2);
+ return 0;
}