diff options
author | ru <ru@FreeBSD.org> | 2003-07-20 10:24:09 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2003-07-20 10:24:09 +0000 |
commit | 8ad48d0b8153eaa31c20cba4a1bd0e7b9a614740 (patch) | |
tree | 175b27044d8b31e547aa6a1c6444fdfe8f4ee9a5 /bin | |
parent | 9cfef4758da1e61017f6dd00d4929ed09a2df666 (diff) | |
download | FreeBSD-src-8ad48d0b8153eaa31c20cba4a1bd0e7b9a614740.zip FreeBSD-src-8ad48d0b8153eaa31c20cba4a1bd0e7b9a614740.tar.gz |
Make this code WARNS=6 clean again (after GCC 3.1.1 import).
Submitted by: Marius Strobl <marius@alchemy.franken.de>
Diffstat (limited to 'bin')
-rw-r--r-- | bin/ed/Makefile | 1 | ||||
-rw-r--r-- | bin/ed/re.c | 26 |
2 files changed, 13 insertions, 14 deletions
diff --git a/bin/ed/Makefile b/bin/ed/Makefile index de1d285..8455461 100644 --- a/bin/ed/Makefile +++ b/bin/ed/Makefile @@ -8,7 +8,6 @@ MLINKS= ed.1 red.1 .if exists(${.CURDIR}/../../crypto) && !defined(NOCRYPT) && !defined(NO_OPENSSL) DISTRIBUTION=crypto CFLAGS+=-DDES -WARNS= 2 DPADD= ${LIBCRYPTO} LDADD= -lcrypto .endif diff --git a/bin/ed/re.c b/bin/ed/re.c index 234824e..f89ecf9 100644 --- a/bin/ed/re.c +++ b/bin/ed/re.c @@ -41,10 +41,10 @@ const char *errmsg = ""; pattern_t * get_compiled_pattern(void) { - static pattern_t *exp = NULL; + static pattern_t *expr = NULL; static char error[1024]; - char *exps; + char *exprs; char delimiter; int n; @@ -52,27 +52,27 @@ get_compiled_pattern(void) errmsg = "invalid pattern delimiter"; return NULL; } else if (delimiter == '\n' || *++ibufp == '\n' || *ibufp == delimiter) { - if (!exp) + if (!expr) errmsg = "no previous pattern"; - return exp; - } else if ((exps = extract_pattern(delimiter)) == NULL) + return expr; + } else if ((exprs = extract_pattern(delimiter)) == NULL) return NULL; /* buffer alloc'd && not reserved */ - if (exp && !patlock) - regfree(exp); - else if ((exp = (pattern_t *) malloc(sizeof(pattern_t))) == NULL) { + if (expr && !patlock) + regfree(expr); + else if ((expr = (pattern_t *) malloc(sizeof(pattern_t))) == NULL) { fprintf(stderr, "%s\n", strerror(errno)); errmsg = "out of memory"; return NULL; } patlock = 0; - if ((n = regcomp(exp, exps, 0))) { - regerror(n, exp, error, sizeof error); + if ((n = regcomp(expr, exprs, 0))) { + regerror(n, expr, error, sizeof error); errmsg = error; - free(exp); - return exp = NULL; + free(expr); + return expr = NULL; } - return exp; + return expr; } |