server: debug fixes
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/server.c b/server.c
index 8bbac70..79c1041 100644
--- a/server.c
+++ b/server.c
@@ -385,10 +385,11 @@
{
char buffer[1024];
va_list args;
+ size_t len;
va_start(args, format);
- snprintf(buffer, sizeof(buffer), format, args);
+ len = vsnprintf(buffer, sizeof(buffer), format, args);
va_end(args);
- return fio_server_text_output(buffer, strlen(buffer));
+ return fio_server_text_output(buffer, len);
}
diff --git a/server.h b/server.h
index 79449a6..d66782d 100644
--- a/server.h
+++ b/server.h
@@ -74,7 +74,7 @@
memset(cmd, 0, sizeof(*cmd));
cmd->version = cpu_to_le16(FIO_SERVER_VER1);
- cmd->opcode = cpu_to_le16(FIO_NET_CMD_TEXT);
+ cmd->opcode = cpu_to_le16(opcode);
if (pdu) {
cmd->pdu_len = cpu_to_le32(pdu_len);