summaryrefslogtreecommitdiff
path: root/src/tools/ocbr/ocbr.c
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2022-02-25 00:15:32 +0100
committerSander Vrijders <sander@ouroboros.rocks>2022-03-03 12:00:54 +0100
commitdb5e9bf4f884097ec919aa40b02d8eafab05cfa8 (patch)
treeb826849edc13dfce7fd365724e3866636d593ca8 /src/tools/ocbr/ocbr.c
parent42dc4a5ed2037daa5631047af6613a45ad157d13 (diff)
downloadouroboros-db5e9bf4f884097ec919aa40b02d8eafab05cfa8.tar.gz
ouroboros-db5e9bf4f884097ec919aa40b02d8eafab05cfa8.zip
tools: Fix return value on error in ocbr
The ocbr tool was returning 0 on error. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/tools/ocbr/ocbr.c')
-rw-r--r--src/tools/ocbr/ocbr.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/tools/ocbr/ocbr.c b/src/tools/ocbr/ocbr.c
index 2643b588..1d52cc1a 100644
--- a/src/tools/ocbr/ocbr.c
+++ b/src/tools/ocbr/ocbr.c
@@ -155,17 +155,22 @@ int main(int argc, char ** argv)
if (s_apn == NULL) {
printf("No server specified.\n");
usage();
- return 0;
+ return 1;
}
if (size > BUF_SIZE) {
printf("Maximum size: %ld.\n", BUF_SIZE);
- return 0;
+ return 1;
}
if (size < 0) {
printf("Size overflow.\n");
- return 0;
+ return 1;
+ }
+
+ if (rate <= 0) {
+ printf("Invalid rate.\n");
+ return 1;
}
ret = client_main(s_apn, duration, size, rate, flood, sleep);