summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ivy.c1
-rw-r--r--src/ivybuffer.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/src/ivy.c b/src/ivy.c
index af7cdc9..5f5a93c 100644
--- a/src/ivy.c
+++ b/src/ivy.c
@@ -750,6 +750,7 @@ int IvySendMsg(const char *fmt, ...)
static IvyBuffer buffer = { NULL, 0, 0}; /* Use satic mem to eliminate multiple call to malloc /free */
va_list ap;
+ if( fmt == 0 || strlen(fmt) == 0 ) return 0;
va_start( ap, fmt );
buffer.offset = 0;
make_message( &buffer, fmt, ap );
diff --git a/src/ivybuffer.c b/src/ivybuffer.c
index 05b4ed1..0d85d98 100644
--- a/src/ivybuffer.c
+++ b/src/ivybuffer.c
@@ -40,7 +40,7 @@ int make_message(IvyBuffer* buffer, const char *fmt, va_list ap)
if ( buffer->data == NULL )
{
perror(" Ivy make message MALLOC error: " );
- return -1;
+ return -1;
}
}
while (1) {
@@ -63,7 +63,7 @@ int make_message(IvyBuffer* buffer, const char *fmt, va_list ap)
buffer->size *= 2; /* twice the old size */
if ((buffer->data = realloc (buffer->data, buffer->size)) == NULL)
{
- perror(" Ivy make message MALLOC error: " );
+ perror(" Ivy make message REALLOC error: " );
return -1;
}
}