- /* must be present */
- if (url->host)
- strfcpy (account->host, url->host, sizeof (account->host));
- else
- return -1;
-
- if (url->user) {
- strfcpy (account->user, url->user, sizeof (account->user));
- account->flags |= M_ACCT_USER;
- }
- if (url->pass) {
- strfcpy (account->pass, url->pass, sizeof (account->pass));
- account->flags |= M_ACCT_PASS;
- }
- if (url->port) {
- account->port = url->port;
- account->flags |= M_ACCT_PORT;
- }
+ /* must be present */
+ if (!url->host)
+ return -1;
+ m_strcpy(account->host, sizeof(account->host), url->host);
+
+ if (url->user) {
+ m_strcpy(account->user, sizeof(account->user), url->user);
+ account->flags |= M_ACCT_USER;
+ }
+ if (url->pass) {
+ m_strcpy(account->pass, sizeof(account->pass), url->pass);
+ account->flags |= M_ACCT_PASS;
+ }
+ if (url->port) {
+ account->port = url->port;
+ account->flags |= M_ACCT_PORT;
+ }