diff options
author | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-11 01:01:39 +0000 |
---|---|---|
committer | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-11 01:01:39 +0000 |
commit | 549c23a966b0ee04c3dec7a787365dade180bb82 (patch) | |
tree | 301b0491350d6adbaa8e49afcd1e88354cdd6008 /res/res_config_ldap.c | |
parent | 13d3de88d30fffaa2f9e1284a18f80bb1969dd93 (diff) |
Merged revisions 129864 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r129864 | seanbright | 2008-07-10 20:55:06 -0400 (Thu, 10 Jul 2008) | 1 line
Fix some usages of snprintf, and clarify a couple variable names.
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@129865 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_config_ldap.c')
-rw-r--r-- | res/res_config_ldap.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/res/res_config_ldap.c b/res/res_config_ldap.c index 6b20ab53b..1e178cdcd 100644 --- a/res/res_config_ldap.c +++ b/res/res_config_ldap.c @@ -1525,7 +1525,7 @@ static int ldap_reconnect(void) static char *realtime_ldap_status(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { - char status[256], status2[100] = ""; + char status[256], credentials[100] = ""; int ctime = time(NULL) - connect_time; switch (cmd) { @@ -1546,26 +1546,26 @@ static char *realtime_ldap_status(struct ast_cli_entry *e, int cmd, struct ast_c snprintf(status, sizeof(status), "Connected to '%s', baseDN %s", url, basedn); if (!ast_strlen_zero(user)) - snprintf(status2, sizeof(status2), " with username %s", user); + snprintf(credentials, sizeof(credentials), " with username %s", user); if (ctime > 31536000) { ast_cli(a->fd, "%s%s for %d years, %d days, %d hours, %d minutes, %d seconds.\n", - status, status2, ctime / 31536000, + status, credentials, ctime / 31536000, (ctime % 31536000) / 86400, (ctime % 86400) / 3600, (ctime % 3600) / 60, ctime % 60); } else if (ctime > 86400) { ast_cli(a->fd, "%s%s for %d days, %d hours, %d minutes, %d seconds.\n", - status, status2, ctime / 86400, (ctime % 86400) / 3600, + status, credentials, ctime / 86400, (ctime % 86400) / 3600, (ctime % 3600) / 60, ctime % 60); } else if (ctime > 3600) { ast_cli(a->fd, "%s%s for %d hours, %d minutes, %d seconds.\n", - status, status2, ctime / 3600, (ctime % 3600) / 60, + status, credentials, ctime / 3600, (ctime % 3600) / 60, ctime % 60); } else if (ctime > 60) { - ast_cli(a->fd, "%s%s for %d minutes, %d seconds.\n", status, status2, + ast_cli(a->fd, "%s%s for %d minutes, %d seconds.\n", status, credentials, ctime / 60, ctime % 60); } else { - ast_cli(a->fd, "%s%s for %d seconds.\n", status, status2, ctime); + ast_cli(a->fd, "%s%s for %d seconds.\n", status, credentials, ctime); } return CLI_SUCCESS; |