summaryrefslogtreecommitdiffstats
path: root/tests/lib/test_buffer.c
diff options
context:
space:
mode:
authorwhitespace / reindent <invalid@invalid.invalid>2017-07-17 14:03:14 +0200
committerwhitespace / reindent <invalid@invalid.invalid>2017-07-17 14:04:07 +0200
commitd62a17aedeb0eebdba98238874bb13d62c48dbf9 (patch)
tree3b319b1d61c8b85b4d1f06adf8b844bb8a9b5107 /tests/lib/test_buffer.c
parent*: add indent control files (diff)
downloadfrr-d62a17aedeb0eebdba98238874bb13d62c48dbf9.tar.xz
frr-d62a17aedeb0eebdba98238874bb13d62c48dbf9.zip
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.c56
1 files changed, 27 insertions, 29 deletions
diff --git a/tests/lib/test_buffer.c b/tests/lib/test_buffer.c
index b9f5fd725..b56cc30cf 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.
@@ -25,35 +25,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;
}