core: check argc/argv uncoditionally

as `assert()` might be dropped with `-DNDEBUG`.

Follow-up to cf3095a and 1637e75.
This commit is contained in:
Frantisek Sumsal
2022-01-31 20:00:40 +09:00
committed by Yu Watanabe
parent 256ce2e889
commit 61b9769bda
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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; \