summaryrefslogtreecommitdiffstats
path: root/regress/lib/libc/regex/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'regress/lib/libc/regex/main.c')
-rw-r--r--regress/lib/libc/regex/main.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/regress/lib/libc/regex/main.c b/regress/lib/libc/regex/main.c
index 8d88a8b9b81..add5e8be103 100644
--- a/regress/lib/libc/regex/main.c
+++ b/regress/lib/libc/regex/main.c
@@ -1,10 +1,13 @@
+/* $OpenBSD: main.c,v 1.2 1996/12/21 22:23:42 millert Exp $ */
/* $NetBSD: main.c,v 1.2 1995/04/20 22:39:51 cgd Exp $ */
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <regex.h>
#include <assert.h>
+#include <unistd.h>
#include "main.ih"
@@ -25,6 +28,7 @@ extern void regprint();
/*
- main - do the simple case, hand off to regress() for regression
*/
+int
main(argc, argv)
int argc;
char *argv[];
@@ -102,10 +106,10 @@ char *argv[];
exit(status);
}
if (!(copts&REG_NOSUB)) {
- len = (int)(subs[0].rm_eo - subs[0].rm_so);
+ len = (size_t)(subs[0].rm_eo - subs[0].rm_so);
if (subs[0].rm_so != -1) {
if (len != 0)
- printf("match `%.*s'\n", len,
+ printf("match `%.*s'\n", (int)len,
argv[optind] + subs[0].rm_so);
else
printf("match `'@%.1s\n",
@@ -501,7 +505,6 @@ efind(name)
char *name;
{
static char efbuf[100];
- size_t n;
regex_t re;
sprintf(efbuf, "REG_%s", name);