1
0
mirror of https://github.com/samba-team/samba.git synced 2025-10-28 03:33:13 +03:00

r25207: remove one nesting level and use unlikely()

metze
This commit is contained in:
Stefan Metzmacher
2007-09-18 11:52:35 +00:00
committed by Gerald (Jerry) Carter
parent 92106e6b7e
commit c2931540bc

View File

@@ -1186,18 +1186,18 @@ char *talloc_vasprintf(const void *t, const char *fmt, va_list ap)
va_copy(ap2, ap);
len = vsnprintf(&c, 1, fmt, ap2);
va_end(ap2);
if (len < 0) {
if (unlikely(len < 0)) {
return NULL;
}
ret = (char *)__talloc(t, len+1);
if (ret) {
va_copy(ap2, ap);
vsnprintf(ret, len+1, fmt, ap2);
va_end(ap2);
_talloc_set_name_const(ret, ret);
}
if (unlikely(!ret)) return NULL;
va_copy(ap2, ap);
vsnprintf(ret, len+1, fmt, ap2);
va_end(ap2);
_talloc_set_name_const(ret, ret);
return ret;
}