diff options
author | Warner Losh <imp@FreeBSD.org> | 2019-06-02 04:23:56 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2019-06-02 04:23:56 +0000 |
commit | 03ee4d05f1d963d60451e04ce505e4da116300db (patch) | |
tree | 9dcabc6cffafcb6b8195148feb519d575b0bf6ac /main.c | |
parent | 3a4488f93f2dc8fe9de757a418b74aa0aa4f9ed1 (diff) |
Notes
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ****************************************************************/ -const char *version = "version 20121220"; +const char *version = "version 20190529"; #define DEBUG #include <stdio.h> @@ -54,6 +54,13 @@ int curpfile = 0; /* current filename */ int safe = 0; /* 1 => "safe" mode */ +/* Can this work with recursive calls? I don't think so. +void segvcatch(int n) +{ + FATAL("segfault. Do you have an unbounded recursive call?", n); +} +*/ + int main(int argc, char *argv[]) { const char *fs = NULL; @@ -68,6 +75,7 @@ int main(int argc, char *argv[]) exit(1); } signal(SIGFPE, fpecatch); + /*signal(SIGSEGV, segvcatch); experiment */ srand_seed = 1; srand(srand_seed); @@ -80,7 +88,7 @@ int main(int argc, char *argv[]) exit(0); break; } - if (strncmp(argv[1], "--", 2) == 0) { /* explicit end of args */ + if (strcmp(argv[1], "--") == 0) { /* explicit end of args */ argc--; argv++; break; |