From 0b535fd267e5b8ebc031b5ca24984102adada87a Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 22 Jan 2024 00:59:55 +0000 Subject: driver: slbt_main(): --version conformance: print program version, then exit. --- src/driver/slbt_amain.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/driver/slbt_amain.c') diff --git a/src/driver/slbt_amain.c b/src/driver/slbt_amain.c index 1cc1c07..2359293 100644 --- a/src/driver/slbt_amain.c +++ b/src/driver/slbt_amain.c @@ -176,10 +176,11 @@ int slbt_main(char ** argv, char ** envp, const struct slbt_fd_ctx * fdctx) return slbt_output_machine(dctx) ? SLBT_ERROR : SLBT_OK; - /* --version is always the first action */ + /* --version must be the first (and only) action */ if (dctx->cctx->drvflags & SLBT_DRIVER_VERSION) - if ((slbt_version(dctx,fdout)) < 0) - return slbt_exit(dctx,SLBT_ERROR); + return (slbt_version(dctx,fdout) < 0) + ? slbt_exit(dctx,SLBT_ERROR) + : slbt_exit(dctx,SLBT_OK); slbt_perform_driver_actions(dctx); -- cgit v1.2.3