core: check argc/argv uncoditionally
as `assert()` might be dropped with `-DNDEBUG`. Follow-up tocf3095aand1637e75.
This commit is contained in:
committed by
Yu Watanabe
parent
256ce2e889
commit
61b9769bda
+1
-1
@@ -2726,7 +2726,7 @@ int main(int argc, char *argv[]) {
|
||||
Manager *m = NULL;
|
||||
FDSet *fds = NULL;
|
||||
|
||||
assert(argc > 0 && !isempty(argv[0]));
|
||||
assert_se(argc > 0 && !isempty(argv[0]));
|
||||
|
||||
/* SysV compatibility: redirect init → telinit */
|
||||
redirect_telinit(argc, argv);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#define _DEFINE_MAIN_FUNCTION(intro, impl, ret) \
|
||||
int main(int argc, char *argv[]) { \
|
||||
int r; \
|
||||
assert(argc > 0 && !isempty(argv[0])); \
|
||||
assert_se(argc > 0 && !isempty(argv[0])); \
|
||||
save_argc_argv(argc, argv); \
|
||||
intro; \
|
||||
r = impl; \
|
||||
|
||||
Reference in New Issue
Block a user