mirror of
https://github.com/samba-team/samba.git
synced 2025-11-06 08:23:50 +03:00
r4550: talloc() is now typesafe. It is exactly equivalent to the old talloc_p() macro. Use
talloc_size() if you want the old behaviour. I have kept talloc_p() as an alias for now. Once we change all calls to be plain talloc() then we can remove it.
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
89b74b5354
commit
2011bbeb84
@@ -857,7 +857,7 @@ char *talloc_strndup(const void *t, const char *p, size_t n)
|
||||
|
||||
for (len=0; p[len] && len<n; len++) ;
|
||||
|
||||
ret = talloc(t, len + 1);
|
||||
ret = _talloc(t, len + 1);
|
||||
if (!ret) { return NULL; }
|
||||
memcpy(ret, p, len);
|
||||
ret[len] = 0;
|
||||
@@ -883,7 +883,7 @@ char *talloc_vasprintf(const void *t, const char *fmt, va_list ap)
|
||||
|
||||
len = vsnprintf(NULL, 0, fmt, ap2);
|
||||
|
||||
ret = talloc(t, len+1);
|
||||
ret = _talloc(t, len+1);
|
||||
if (ret) {
|
||||
VA_COPY(ap2, ap);
|
||||
vsnprintf(ret, len+1, fmt, ap2);
|
||||
|
||||
Reference in New Issue
Block a user