diff options
author | Dimitri Staessens <[email protected]> | 2022-02-25 00:15:32 +0100 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2022-03-03 12:00:54 +0100 |
commit | db5e9bf4f884097ec919aa40b02d8eafab05cfa8 (patch) | |
tree | b826849edc13dfce7fd365724e3866636d593ca8 /src/tools | |
parent | 42dc4a5ed2037daa5631047af6613a45ad157d13 (diff) | |
download | ouroboros-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 <[email protected]>
Signed-off-by: Sander Vrijders <[email protected]>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/ocbr/ocbr.c | 11 |
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); |