diff options
author | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2018-01-16 22:52:33 +0000 |
---|---|---|
committer | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2018-01-16 22:52:33 +0000 |
commit | 912194b99b5052b815d28bd8ce3752c1212af241 (patch) | |
tree | c9008f1acdeb7347f50f1720a55e5ef04012d98e /bin/ksh/eval.c | |
parent | 4a4314b548e46aa0214ec94a4f342d830019a314 (diff) |
Introduce internal_warningf() and mark internal_errorf() as noreturn
This helps tools like scan-build, and follows the example of warningf()
and errorf(). ok anton@
Diffstat (limited to 'bin/ksh/eval.c')
-rw-r--r-- | bin/ksh/eval.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/ksh/eval.c b/bin/ksh/eval.c index 7bc9b8bd721..a8dc698bd44 100644 --- a/bin/ksh/eval.c +++ b/bin/ksh/eval.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eval.c,v 1.58 2018/01/14 16:04:21 anton Exp $ */ +/* $OpenBSD: eval.c,v 1.59 2018/01/16 22:52:32 jca Exp $ */ /* * Expansion - quoting, separation, substitution, globbing @@ -69,7 +69,7 @@ substitute(const char *cp, int f) s->start = s->str = cp; source = s; if (yylex(ONEWORD) != LWORD) - internal_errorf(1, "substitute"); + internal_errorf("substitute"); source = sold; afree(s, ATEMP); return evalstr(yylval.cp, f); @@ -168,7 +168,7 @@ expand(char *cp, /* input word */ size_t len; if (cp == NULL) - internal_errorf(1, "expand(NULL)"); + internal_errorf("expand(NULL)"); /* for alias, readonly, set, typeset commands */ if ((f & DOVACHECK) && is_wdvarassign(cp)) { f &= ~(DOVACHECK|DOBLANK|DOGLOB|DOTILDE); @@ -587,7 +587,7 @@ expand(char *cp, /* input word */ char *p; if ((p = strdup("")) == NULL) - internal_errorf(1, "unable " + internal_errorf("unable " "to allocate memory"); XPput(*wp, p); } |