build_msg: clean up invocation of olsr_exit
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 5 Nov 2015 23:00:15 +0000 (00:00 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 6 Nov 2015 15:26:23 +0000 (16:26 +0100)
olsr_exit already logs to the syslog and also prints
the message

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/build_msg.c

index 281148b..fe2cecb 100644 (file)
@@ -231,9 +231,9 @@ static void
 check_buffspace(int msgsize, int buffsize, const char *type)
 {
   if (msgsize > buffsize) {
-    OLSR_PRINTF(1, "%s build, outputbuffer to small(%d/%u)!\n", type, msgsize, buffsize);
-    olsr_syslog(OLSR_LOG_ERR, "%s build, outputbuffer to small(%d/%u)!\n", type, msgsize, buffsize);
-    olsr_exit(__func__, EXIT_FAILURE);
+    char buf[1024];
+    snprintf(buf, sizeof(buf), "%s: %s build, output buffer too small (%d/%u)", __func__, type, msgsize, buffsize);
+    olsr_exit(buf, EXIT_FAILURE);
   }
 }