if (script[0] == '/')
ast_copy_string(fn, script, sizeof(fn));
else
- snprintf(fn, sizeof(fn), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, script);
+ snprintf(fn, sizeof(fn), "%s/%s", ast_config_AST_CONFIG_DIR, script);
if (!(f = fopen(fn, "r"))) {
ast_log(LOG_WARNING, "Can't open file '%s'\n", fn);
if (((char *)data)[0] == '/')
ast_copy_string(filename, (char *) data, sizeof(filename));
else
- snprintf(filename, sizeof(filename), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, (char *)data);
+ snprintf(filename, sizeof(filename), "%s/%s", ast_config_AST_CONFIG_DIR, (char *)data);
/* Placeholder for options */
c = strchr(filename, '|');
if (c)
return -1;
}
- snprintf(tmp, sizeof(tmp), "%s/%s/%s.csv", (char *)ast_config_AST_LOG_DIR,CSV_LOG_DIR, acc);
+ snprintf(tmp, sizeof(tmp), "%s/%s/%s.csv", ast_config_AST_LOG_DIR,CSV_LOG_DIR, acc);
ast_mutex_lock(&acf_lock);
if (!(f = fopen(tmp, "a"))) {
/* Now that we have marked them dead... load new ones */
if (!unload) {
- snprintf(dir, sizeof(dir), "%s/firmware/iax", (char *)ast_config_AST_DATA_DIR);
+ snprintf(dir, sizeof(dir), "%s/firmware/iax", ast_config_AST_DATA_DIR);
fwd = opendir(dir);
if (fwd) {
while((de = readdir(fwd))) {
return -1;
}
- snprintf(tmp, sizeof(tmp), "%s/%s", (char *) ast_config_AST_LOG_DIR, USTM_LOG_DIR);
+ snprintf(tmp, sizeof(tmp), "%s/%s", ast_config_AST_LOG_DIR, USTM_LOG_DIR);
if (ast_mkdir(tmp, 0770)) {
if (errno != EEXIST) {
display_last_error("Unable to create directory for history");
atm.tm_year + 1900, atm.tm_mon + 1, atm.tm_mday, atm.tm_hour,
atm.tm_min, atm.tm_sec, tmp2);
- snprintf(tmp, sizeof(tmp), "%s/%s/%s-%c.csv", (char *) ast_config_AST_LOG_DIR,
+ snprintf(tmp, sizeof(tmp), "%s/%s/%s-%c.csv", ast_config_AST_LOG_DIR,
USTM_LOG_DIR, pte->device->name, way);
if ((f = fopen(tmp, "r"))) {
struct stat bufstat;
fclose(f);
return -1;
}
- snprintf(tmp2, sizeof(tmp2), "%s/%s/%s-%c.csv.tmp", (char *) ast_config_AST_LOG_DIR,
+ snprintf(tmp2, sizeof(tmp2), "%s/%s/%s-%c.csv.tmp", ast_config_AST_LOG_DIR,
USTM_LOG_DIR, pte->device->name, way);
if (!(f2 = fopen(tmp2, "w"))) {
display_last_error("Unable to create temporary history log.");
char tmp[AST_CONFIG_MAX_PATH];
char count;
- snprintf(tmp, sizeof(tmp), "%s/%s/%s-%c.csv", (char *) ast_config_AST_LOG_DIR,
+ snprintf(tmp, sizeof(tmp), "%s/%s/%s-%c.csv", ast_config_AST_LOG_DIR,
USTM_LOG_DIR, pte->device->name, way);
*f = fopen(tmp, "r");
if (!*f) {
}
memset(&sunaddr, 0, sizeof(sunaddr));
sunaddr.sun_family = AF_LOCAL;
- ast_copy_string(sunaddr.sun_path, (char *) ast_config_AST_SOCKET, sizeof(sunaddr.sun_path));
+ ast_copy_string(sunaddr.sun_path, ast_config_AST_SOCKET, sizeof(sunaddr.sun_path));
res = connect(ast_consock, (struct sockaddr *)&sunaddr, sizeof(sunaddr));
if (res) {
close(ast_consock);
ast_cli_register_multiple(cli_memory, sizeof(cli_memory) / sizeof(struct ast_cli_entry));
- snprintf(filename, sizeof(filename), "%s/mmlog", (char *)ast_config_AST_LOG_DIR);
+ snprintf(filename, sizeof(filename), "%s/mmlog", ast_config_AST_LOG_DIR);
if (option_verbose)
ast_verbose("Asterisk Malloc Debugger Started (see %s))\n", filename);
if (filename[0] == '/') {
ast_copy_string(fn, filename, sizeof(fn));
} else {
- snprintf(fn, sizeof(fn), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, filename);
+ snprintf(fn, sizeof(fn), "%s/%s", ast_config_AST_CONFIG_DIR, filename);
}
if (ast_test_flag(&flags, CONFIG_FLAG_WITHCOMMENTS)) {
static int dbinit(void)
{
- if (!astdb && !(astdb = dbopen((char *)ast_config_AST_DB, O_CREAT | O_RDWR, AST_FILE_MODE, DB_BTREE, NULL))) {
+ if (!astdb && !(astdb = dbopen(ast_config_AST_DB, O_CREAT | O_RDWR, AST_FILE_MODE, DB_BTREE, NULL))) {
ast_log(LOG_WARNING, "Unable to open Asterisk database '%s': %s\n", ast_config_AST_DB, strerror(errno));
return -1;
}
}
/* Load new keys */
- if ((dir = opendir((char *)ast_config_AST_KEY_DIR))) {
+ if ((dir = opendir(ast_config_AST_KEY_DIR))) {
while((ent = readdir(dir))) {
- try_load_key((char *)ast_config_AST_KEY_DIR, ent->d_name, ifd, ofd, ¬e);
+ try_load_key(ast_config_AST_KEY_DIR, ent->d_name, ifd, ofd, ¬e);
}
closedir(dir);
} else
- ast_log(LOG_WARNING, "Unable to open key directory '%s'\n", (char *)ast_config_AST_KEY_DIR);
+ ast_log(LOG_WARNING, "Unable to open key directory '%s'\n", ast_config_AST_KEY_DIR);
if (note)
ast_log(LOG_NOTICE, "Please run the command 'init keys' to enter the passcodes for the keys\n");
if (key->ktype & KEY_NEEDS_PASSCODE) {
kn = key->fn + strlen(ast_config_AST_KEY_DIR) + 1;
ast_copy_string(tmp, kn, sizeof(tmp));
- try_load_key((char *) ast_config_AST_KEY_DIR, tmp, a->fd, a->fd, &ign);
+ try_load_key(ast_config_AST_KEY_DIR, tmp, a->fd, a->fd, &ign);
}
}
AST_RWLIST_TRAVERSE_SAFE_END
if (use_local_dir)
snprintf(fn, sizeof(fn), "./%s", filename);
else
- snprintf(fn, sizeof(fn), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, filename);
+ snprintf(fn, sizeof(fn), "%s/%s", ast_config_AST_CONFIG_DIR, filename);
}
if (withcomments && cfg && cfg->include_level < 2 ) {