From 1d43b3c6f3a7070cbc7b06b016aff1464fb80ba8 Mon Sep 17 00:00:00 2001 From: Yasushi SHOJI Date: Thu, 6 Apr 2023 16:24:01 +0900 Subject: [PATCH] canbusload: Enhance error message for missing bitrate When canbusload is executed without bit rate, it exits with an exit code of 1 and prints help, but without explaining why. Users cannot know what was wrong. When other errors occur, though, canbusload prints an error message along with the help. Print an error message when bit rate is not given or "@" is not found. Signed-off-by: Yasushi SHOJI --- canbusload.c | 1 + 1 file changed, 1 insertion(+) diff --git a/canbusload.c b/canbusload.c index 83a6c80..4e50d06 100644 --- a/canbusload.c +++ b/canbusload.c @@ -325,6 +325,7 @@ int main(int argc, char **argv) nptr = strchr(ptr, '@'); if (!nptr) { + fprintf(stderr, "Specify CAN interfaces in the form @, e.g. can0@500000\n"); print_usage(prg); return 1; }