From a2a5df7b72858cc1c224b61d6cf957489c77d04d Mon Sep 17 00:00:00 2001 From: JustinAJ Date: Sun, 8 Jun 2014 22:21:36 -0400 Subject: [PATCH] Updated format string. --- Jupiter/IRC_Client.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jupiter/IRC_Client.cpp b/Jupiter/IRC_Client.cpp index b282481..fdb1b63 100644 --- a/Jupiter/IRC_Client.cpp +++ b/Jupiter/IRC_Client.cpp @@ -1218,9 +1218,9 @@ int Jupiter::IRC::Client::primaryHandler() { size_t authStringLen = Jupiter::IRC::Client::data_->nickname.size() + Jupiter::IRC::Client::data_->saslAccount.size() + Jupiter::IRC::Client::data_->saslPass.size() + 2; char *authString = new char[authStringLen + 1]; - int offset = sprintf(authString, "%s", Jupiter::IRC::Client::data_->nickname.c_str()) + 1; - offset += sprintf(authString + offset, "%s", Jupiter::IRC::Client::data_->saslAccount.c_str()) + 1; - offset += sprintf(authString + offset, "%s", Jupiter::IRC::Client::data_->saslPass.c_str()); + int offset = sprintf(authString, "%.*s", Jupiter::IRC::Client::data_->nickname.size(), Jupiter::IRC::Client::data_->nickname.ptr()) + 1; + offset += sprintf(authString + offset, "%.*s", Jupiter::IRC::Client::data_->saslAccount.size(), Jupiter::IRC::Client::data_->saslAccount.ptr()) + 1; + offset += sprintf(authString + offset, "%.*s", Jupiter::IRC::Client::data_->saslPass.size(), Jupiter::IRC::Client::data_->saslPass.ptr()); char *enc = Jupiter::base64encode(authString, authStringLen); delete[] authString;