Format per CODING_STYLE

Signed-off-by: malc <av1474@comtv.ru>
stable-0.11
malc 2009-05-19 22:28:26 +04:00
parent a7d27b536f
commit 26d64a85a3
1 changed files with 10 additions and 6 deletions

View File

@ -26,8 +26,9 @@
static void *oom_check(void *ptr)
{
if (ptr == NULL)
if (ptr == NULL) {
abort();
}
return ptr;
}
@ -43,18 +44,20 @@ void qemu_free(void *ptr)
void *qemu_malloc(size_t size)
{
if (!size)
if (!size) {
abort();
}
return oom_check(malloc(size));
}
void *qemu_realloc(void *ptr, size_t size)
{
if (size)
if (size) {
return oom_check(realloc(ptr, size));
else {
if (ptr)
} else {
if (ptr) {
return realloc(ptr, size);
}
}
abort();
}
@ -81,8 +84,9 @@ char *qemu_strndup(const char *str, size_t size)
const char *end = memchr(str, 0, size);
char *new;
if (end)
if (end) {
size = end - str;
}
new = qemu_malloc(size + 1);
new[size] = 0;