diff options
Diffstat (limited to 'misc')
-rw-r--r-- | misc/regexp.h | 10 | ||||
-rw-r--r-- | misc/ttyslot.c | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/misc/regexp.h b/misc/regexp.h index f31b1af1d0..04da70a534 100644 --- a/misc/regexp.h +++ b/misc/regexp.h @@ -38,9 +38,12 @@ for the here included function is weird (this really is a harmless word). - The user has to provide five macros before this header file can be + The user has to provide six macros before this header file can be included: + INIT Declarations vor variables which can be used by the + other macros. + GETC() Return the value of the next character in the regular expression pattern. Successive calls should return successive characters. @@ -98,9 +101,10 @@ compile (char *__instring, char *__expbuf, __const char *__endbuf, int __eof) { char *__input_buffer = NULL; size_t __input_size = 0; - size_t __current_size; + size_t __current_size = 0; int __ch; int __error; + INIT /* Align the expression buffer according to the needs for an object of type `regex_t'. Then check for minimum size of the buffer for @@ -191,7 +195,7 @@ compile (char *__instring, char *__expbuf, __const char *__endbuf, int __eof) } /* Everything is ok. */ - RETURN ((char *) (__expr_ptr->buffer + __expr->used)); + RETURN ((char *) (__expr_ptr->buffer + __expr_ptr->used)); } #endif diff --git a/misc/ttyslot.c b/misc/ttyslot.c index 794cada0af..430f9c02d0 100644 --- a/misc/ttyslot.c +++ b/misc/ttyslot.c @@ -59,7 +59,7 @@ ttyslot() setttyent(); for (cnt = 0; cnt < 3; ++cnt) - if (__ttyname_r (cnt, name, buflen) >= 0) { + if (__ttyname_r (cnt, name, buflen) == 0) { if (p = rindex(name, '/')) ++p; else |