Thread (49 messages) flat view 49 messages, 2 authors, 2018-11-10
STALE2861d

Revision v2 of 5 in this series.

Revisions (5)
  1. v1 [diff vs current]
  2. v1 [diff vs current]
  3. v3 [diff vs current]
  4. v2 current
  5. v3 [diff vs current]

[PATCH v2 13/16] parse-options.c: turn some die() to BUG()

From: Nguyễn Thái Ngọc Duy <hidden>
Date: 2018-11-05 19:21:26
Subsystem: the rest · Maintainer: Linus Torvalds

These two strings are clearly not for the user to see. Reduce the
violence in one string while at there.

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
---
 parse-options.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/parse-options.c b/parse-options.c
index 0bf817193d..3f5f985c1e 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -197,7 +197,7 @@ static int get_value(struct parse_opt_ctx_t *p,
 		return 0;
 
 	default:
-		die("should not happen, someone must be hit on the forehead");
+		BUG("opt->type %d should not happen", opt->type);
 	}
 }
 
@@ -424,7 +424,7 @@ void parse_options_start(struct parse_opt_ctx_t *ctx,
 	ctx->flags = flags;
 	if ((flags & PARSE_OPT_KEEP_UNKNOWN) &&
 	    (flags & PARSE_OPT_STOP_AT_NON_OPTION))
-		die("STOP_AT_NON_OPTION and KEEP_UNKNOWN don't go together");
+		BUG("STOP_AT_NON_OPTION and KEEP_UNKNOWN don't go together");
 	parse_options_check(options);
 }
 
-- 
2.19.1.1005.gac84295441
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help