diff options
author | James Peach <jpeach@samba.org> | 2007-06-15 21:58:49 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:23:23 -0500 |
commit | b1ce226af8b61ad7e3c37860a59c6715012e738b (patch) | |
tree | 4067151ac0de549002434afb9f42e75f052c6754 /source3/lib/util.c | |
parent | aa4110e6f2432d76926198ce7a2a4adea4e1860a (diff) | |
download | samba-b1ce226af8b61ad7e3c37860a59c6715012e738b.tar.gz samba-b1ce226af8b61ad7e3c37860a59c6715012e738b.tar.bz2 samba-b1ce226af8b61ad7e3c37860a59c6715012e738b.zip |
r23510: Tidy calls to smb_panic by removing trailing newlines. Print the
failed expression in SMB_ASSERT.
(This used to be commit 171dc060e2a576d724eed1ca65636bdafffd7713)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r-- | source3/lib/util.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index 3d72eb5d29..7a927fb3e8 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -2469,15 +2469,16 @@ int smb_mkstemp(char *name_template) void *smb_xmalloc_array(size_t size, unsigned int count) { void *p; - if (size == 0) - smb_panic("smb_xmalloc_array: called with zero size.\n"); + if (size == 0) { + smb_panic("smb_xmalloc_array: called with zero size"); + } if (count >= MAX_ALLOC_SIZE/size) { - smb_panic("smb_xmalloc: alloc size too large.\n"); + smb_panic("smb_xmalloc_array: alloc size too large"); } if ((p = SMB_MALLOC(size*count)) == NULL) { DEBUG(0, ("smb_xmalloc_array failed to allocate %lu * %lu bytes\n", (unsigned long)size, (unsigned long)count)); - smb_panic("smb_xmalloc_array: malloc fail.\n"); + smb_panic("smb_xmalloc_array: malloc failed"); } return p; } @@ -2517,8 +2518,9 @@ char *smb_xstrdup(const char *s) #endif #define strdup(s) __ERROR_DONT_USE_STRDUP_DIRECTLY #endif - if (!s1) - smb_panic("smb_xstrdup: malloc fail\n"); + if (!s1) { + smb_panic("smb_xstrdup: malloc failed"); + } return s1; } @@ -2547,8 +2549,9 @@ char *smb_xstrndup(const char *s, size_t n) #endif #define strndup(s,n) __ERROR_DONT_USE_STRNDUP_DIRECTLY #endif - if (!s1) - smb_panic("smb_xstrndup: malloc fail\n"); + if (!s1) { + smb_panic("smb_xstrndup: malloc failed"); + } return s1; } @@ -2564,8 +2567,9 @@ char *smb_xstrndup(const char *s, size_t n) VA_COPY(ap2, ap); n = vasprintf(ptr, format, ap2); - if (n == -1 || ! *ptr) + if (n == -1 || ! *ptr) { smb_panic("smb_xvasprintf: out of memory"); + } return n; } @@ -2998,7 +3002,7 @@ void *talloc_check_name_abort(const void *ptr, const char *name) DEBUG(0, ("Talloc type mismatch, expected %s, got %s\n", name, talloc_get_name(ptr))); - smb_panic("aborting"); + smb_panic("talloc type mismatch"); /* Keep the compiler happy */ return NULL; } |