From e888f1834b88270590b7e04d64c03c75863e4565 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 16 Jul 2010 13:17:58 +0300 Subject: Move to gawk-3.1.2. --- awklib/eg/lib/grcat.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'awklib/eg/lib/grcat.c') diff --git a/awklib/eg/lib/grcat.c b/awklib/eg/lib/grcat.c index 802aa639..c022dc7e 100644 --- a/awklib/eg/lib/grcat.c +++ b/awklib/eg/lib/grcat.c @@ -12,9 +12,13 @@ #if HAVE_CONFIG_H #include #endif + +#if defined (STDC_HEADERS) +#include +#endif -#ifndef HAVE_GETPGRENT -int main() { exit(0); } +#ifndef HAVE_GETGRENT +int main() { return 0; } #else #include #include @@ -28,8 +32,8 @@ char **argv; int i; while ((g = getgrent()) != NULL) { - printf("%s:%s:%d:", g->gr_name, g->gr_passwd, - g->gr_gid); + printf("%s:%s:%ld:", g->gr_name, g->gr_passwd, + (long) g->gr_gid); for (i = 0; g->gr_mem[i] != NULL; i++) { printf("%s", g->gr_mem[i]); if (g->gr_mem[i+1] != NULL) @@ -38,6 +42,6 @@ char **argv; putchar('\n'); } endgrent(); - exit(0); + return 0; } -#endif /* HAVE_GETPGRENT */ +#endif /* HAVE_GETGRENT */ -- cgit v1.2.3