mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Added asserts
This commit is contained in:
parent
3c9155be2c
commit
2cea263917
@ -154,8 +154,8 @@ parse_room_jid(const char * const full_room_jid, char **room, char **nick)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Given a room name, and a nick name create and return a full JID of the form
|
* Given a barejid, and resourcepart, create and return a full JID of the form
|
||||||
* room@server/nick
|
* barejid/resourcepart
|
||||||
* Will return a newly created string that must be freed by the caller
|
* Will return a newly created string that must be freed by the caller
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
|
@ -99,13 +99,17 @@ jabber_init(const int disable_tls)
|
|||||||
jabber_conn_status_t
|
jabber_conn_status_t
|
||||||
jabber_connect_with_account(ProfAccount *account, const char * const passwd)
|
jabber_connect_with_account(ProfAccount *account, const char * const passwd)
|
||||||
{
|
{
|
||||||
|
assert(account != NULL);
|
||||||
|
assert(passwd != NULL);
|
||||||
|
|
||||||
|
log_info("Connecting using account: %s", account->name);
|
||||||
|
|
||||||
|
// save account name and password for reconnect
|
||||||
saved_account.name = strdup(account->name);
|
saved_account.name = strdup(account->name);
|
||||||
saved_account.passwd = strdup(passwd);
|
saved_account.passwd = strdup(passwd);
|
||||||
|
|
||||||
log_info("Connecting using account: %s", account->name);
|
|
||||||
char *fulljid = create_fulljid(account->jid, account->resource);
|
char *fulljid = create_fulljid(account->jid, account->resource);
|
||||||
jabber_conn_status_t result = _jabber_connect(fulljid, passwd, account->server);
|
jabber_conn_status_t result = _jabber_connect(fulljid, passwd, account->server);
|
||||||
|
|
||||||
free(fulljid);
|
free(fulljid);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -314,6 +318,9 @@ static jabber_conn_status_t
|
|||||||
_jabber_connect(const char * const fulljid, const char * const passwd,
|
_jabber_connect(const char * const fulljid, const char * const passwd,
|
||||||
const char * const altdomain)
|
const char * const altdomain)
|
||||||
{
|
{
|
||||||
|
assert(fulljid != NULL);
|
||||||
|
assert(passwd != NULL);
|
||||||
|
|
||||||
Jid *jid = jid_create(fulljid);
|
Jid *jid = jid_create(fulljid);
|
||||||
|
|
||||||
if (jid == NULL) {
|
if (jid == NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user