aboutsummaryrefslogtreecommitdiffstats
path: root/awklib/eg/lib/grcat.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2010-07-16 13:17:58 +0300
committerArnold D. Robbins <arnold@skeeve.com>2010-07-16 13:17:58 +0300
commite888f1834b88270590b7e04d64c03c75863e4565 (patch)
treeab679ecbf16dc4f11b90a53f4b1e0084d78c98b0 /awklib/eg/lib/grcat.c
parentfae4762eba9ff7bb466a600130e9c90eaac6b0bc (diff)
downloadegawk-e888f1834b88270590b7e04d64c03c75863e4565.tar.gz
egawk-e888f1834b88270590b7e04d64c03c75863e4565.tar.bz2
egawk-e888f1834b88270590b7e04d64c03c75863e4565.zip
Move to gawk-3.1.2.
Diffstat (limited to 'awklib/eg/lib/grcat.c')
-rw-r--r--awklib/eg/lib/grcat.c16
1 files changed, 10 insertions, 6 deletions
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 <config.h>
#endif
+
+#if defined (STDC_HEADERS)
+#include <stdlib.h>
+#endif
-#ifndef HAVE_GETPGRENT
-int main() { exit(0); }
+#ifndef HAVE_GETGRENT
+int main() { return 0; }
#else
#include <stdio.h>
#include <grp.h>
@@ -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 */