diff options
author | deischen <deischen@FreeBSD.org> | 2001-06-04 12:36:07 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 2001-06-04 12:36:07 +0000 |
commit | 44f9b5d24741ec013a13e0216f7f13eee0ee6ddd (patch) | |
tree | bef5b1990d5a5791e4a05ec08c31ed6903812f37 /lib/libc/stdio/local.h | |
parent | 9f564ba0bda86acfc7aa6dc4131732e17c3f2ae4 (diff) | |
download | FreeBSD-src-44f9b5d24741ec013a13e0216f7f13eee0ee6ddd.zip FreeBSD-src-44f9b5d24741ec013a13e0216f7f13eee0ee6ddd.tar.gz |
Properly initialize a temporary FILE that is allocated off the stack.
The change to reuse _up from FILE (to allow FILE to grow without changing
size) overlooked FILE being allocated off the stack.
Approved by: sobomax
Diffstat (limited to 'lib/libc/stdio/local.h')
-rw-r--r-- | lib/libc/stdio/local.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libc/stdio/local.h b/lib/libc/stdio/local.h index 4f5242a..3e498d3 100644 --- a/lib/libc/stdio/local.h +++ b/lib/libc/stdio/local.h @@ -103,3 +103,10 @@ struct __sFILEX { free((char *)(fp)->_lb._base); \ (fp)->_lb._base = NULL; \ } + +#define INITEXTRA(fp) { \ + (fp)->_extra->_up = NULL; \ + (fp)->_extra->fl_mutex = PTHREAD_MUTEX_INITIALIZER; \ + (fp)->_extra->fl_owner = NULL; \ + (fp)->_extra->fl_count = 0; \ +} |