aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2020-02-18 21:26:24 +0200
committerArnold D. Robbins <arnold@skeeve.com>2020-02-18 21:26:24 +0200
commited6ff8c1cb3136df1ea34ea2172fa84245c99c2b (patch)
treeb73c2617ab73b8b87ad5d73f67e29a52a25024fa /main.c
parent94e4c04561f7b9c2a3e7ef498fbfe7ce5b20ed40 (diff)
downloadplatform_external_one-true-awk-ed6ff8c1cb3136df1ea34ea2172fa84245c99c2b.tar.gz
platform_external_one-true-awk-ed6ff8c1cb3136df1ea34ea2172fa84245c99c2b.tar.bz2
platform_external_one-true-awk-ed6ff8c1cb3136df1ea34ea2172fa84245c99c2b.zip
Small cleanups before merge to master.
Diffstat (limited to 'main.c')
-rw-r--r--main.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/main.c b/main.c
index 5a1ecbf..5894dde 100644
--- a/main.c
+++ b/main.c
@@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
-const char *version = "version 20200206";
+const char *version = "version 20200218";
#define DEBUG
#include <stdio.h>
@@ -57,24 +57,24 @@ static __attribute__((__noreturn__)) void fpecatch(int n
, siginfo_t *si, void *uc
#endif
)
- {
+{
#ifdef SA_SIGINFO
static const char *emsg[] = {
- [0] = "Unknown error",
- [FPE_INTDIV] = "Integer divide by zero",
- [FPE_INTOVF] = "Integer overflow",
- [FPE_FLTDIV] = "Floating point divide by zero",
- [FPE_FLTOVF] = "Floating point overflow",
- [FPE_FLTUND] = "Floating point underflow",
- [FPE_FLTRES] = "Floating point inexact result",
- [FPE_FLTINV] = "Invalid Floating point operation",
- [FPE_FLTSUB] = "Subscript out of range",
+ [0] = "Unknown error",
+ [FPE_INTDIV] = "Integer divide by zero",
+ [FPE_INTOVF] = "Integer overflow",
+ [FPE_FLTDIV] = "Floating point divide by zero",
+ [FPE_FLTOVF] = "Floating point overflow",
+ [FPE_FLTUND] = "Floating point underflow",
+ [FPE_FLTRES] = "Floating point inexact result",
+ [FPE_FLTINV] = "Invalid Floating point operation",
+ [FPE_FLTSUB] = "Subscript out of range",
};
#endif
FATAL("floating point exception"
#ifdef SA_SIGINFO
- ": %s\n", (size_t)si->si_code < sizeof(emsg) / sizeof(emsg[0]) &&
- emsg[si->si_code] ? emsg[si->si_code] : emsg[0]
+ ": %s", (size_t)si->si_code < sizeof(emsg) / sizeof(emsg[0]) &&
+ emsg[si->si_code] ? emsg[si->si_code] : emsg[0]
#endif
);
}
@@ -144,8 +144,7 @@ int main(int argc, char *argv[])
yyin = NULL;
symtab = makesymtab(NSYMTAB/NSYMTAB);
while (argc > 1 && argv[1][0] == '-' && argv[1][1] != '\0') {
- if (strcmp(argv[1], "-version") == 0 ||
- strcmp(argv[1], "--version") == 0) {
+ if (strcmp(argv[1], "-version") == 0 || strcmp(argv[1], "--version") == 0) {
printf("awk %s\n", version);
return 0;
}
@@ -165,8 +164,7 @@ int main(int argc, char *argv[])
maxpfile += 20;
pfile = realloc(pfile, maxpfile * sizeof(*pfile));
if (pfile == NULL)
- FATAL("error allocating space for "
- "-f options");
+ FATAL("error allocating space for -f options");
}
pfile[npfile++] = fn;
break;