diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-06-10 22:01:32 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-06-10 22:01:32 +0000 |
commit | 8ca489daad37dcf6e4211e248438fe939bdd17c7 (patch) | |
tree | 3459ecaa4ff80de1d2e106d1a1e0328279ed7949 /lib | |
parent | 75c782feebd4948c4688987931125ea98ef4b0f8 (diff) |
- actually zero the memory returned by realloc().
- set the return value for the pthread_once() stub.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libX11/src/UIThrStubs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libX11/src/UIThrStubs.c b/lib/libX11/src/UIThrStubs.c index 7f54aa9fe..bceb4c45e 100644 --- a/lib/libX11/src/UIThrStubs.c +++ b/lib/libX11/src/UIThrStubs.c @@ -177,6 +177,7 @@ _Xthr_once_stub_(void *id, void (*routine)(void)) routine(); done++; } + return 0; } #include <errno.h> @@ -199,8 +200,8 @@ _Xthr_key_create_stub_(unsigned int *key, void (*destructor)(void *)) free(_Xthr_keys_); return ENOMEM; } - for (i =_Xthr_last_key_; i<XTHR_KEYS_CHUNK; i++) - tmp[i] = 0; + for (i = 0; i < XTHR_KEYS_CHUNK; i++) + tmp[_Xthr_last_key_ + i] = 0; _Xthr_keys_ = tmp; } *key = _Xthr_last_key_++; |