diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2006-07-17 17:56:29 +0000 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2006-07-17 17:56:29 +0000 |
commit | af83f5e55c9dd6aaeda6ae1f14a260dd11f54188 (patch) | |
tree | e51e858652aad843028da5155b82c484f51e0ef2 | |
parent | df64399a0111505ef29e6c0bd0306798e0781642 (diff) | |
download | xine-lib-af83f5e55c9dd6aaeda6ae1f14a260dd11f54188.tar.gz xine-lib-af83f5e55c9dd6aaeda6ae1f14a260dd11f54188.tar.bz2 |
Use asprintf() or our implementation of it.
CVS patchset: 8133
CVS date: 2006/07/17 17:56:29
-rw-r--r-- | src/xine-utils/xine_check.c | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/src/xine-utils/xine_check.c b/src/xine-utils/xine_check.c index c2dcccbdf..7bbf645ff 100644 --- a/src/xine-utils/xine_check.c +++ b/src/xine-utils/xine_check.c @@ -93,33 +93,13 @@ set_hc_result(xine_health_check_t* hc, int state, const char *format, ...) _x_abort(); } - size = strlen(format) + 1; + va_start(args, format); + asprintf (&buf, format, args); + va_end(args); - if (!(buf = xine_xmalloc(size))) + if (!buf) _x_abort(); - while(1) { - va_start(args, format); - n = vsnprintf(buf, size, format, args); - va_end(args); - - if(n > -1 && n < size) { - break; - } - - if(n > -1) { - size = n + 1; - } - else { - size *= 2; - } - - if((buf = realloc(buf, size)) == NULL) { - printf("%s() GASP, realloc() failed\n", __XINE_FUNCTION__); - _x_abort(); - } - } - hc->msg = buf; hc->status = state; } |