for ( ; var; var = var->next) {
if (!strcasecmp(var->name, "endtime")) {
- struct ast_tm tm;
- ast_strptime(var->value, "%Y-%m-%d %H:%M:%S", &tm);
- tmp = ast_mktime(&tm, NULL);
+ struct ast_tm endtime_tm;
+ ast_strptime(var->value, "%Y-%m-%d %H:%M:%S", &endtime_tm);
+ tmp = ast_mktime(&endtime_tm, NULL);
localendtime = tmp.tv_sec;
}
}
} else if (!strcasecmp(var->name, "adminopts")) {
ast_copy_string(adminopts, var->value, sizeof(char[OPTIONS_LEN]));
} else if (!strcasecmp(var->name, "endtime")) {
- struct ast_tm tm;
- ast_strptime(var->value, "%Y-%m-%d %H:%M:%S", &tm);
- endtime = ast_mktime(&tm, NULL);
+ struct ast_tm endtime_tm;
+ ast_strptime(var->value, "%Y-%m-%d %H:%M:%S", &endtime_tm);
+ endtime = ast_mktime(&endtime_tm, NULL);
}
}
/* Check if we have a similarly named variable */
if (datefield && tableptr->usegmtime) {
- struct timeval tv = (datefield == 1) ? cdr->start : (datefield == 2) ? cdr->answer : cdr->end;
+ struct timeval date_tv = (datefield == 1) ? cdr->start : (datefield == 2) ? cdr->answer : cdr->end;
struct ast_tm tm = { 0, };
- ast_localtime(&tv, &tm, "UTC");
+ ast_localtime(&date_tv, &tm, "UTC");
ast_strftime(colbuf, sizeof(colbuf), "%Y-%m-%d %H:%M:%S", &tm);
} else {
ast_cdr_getvar(cdr, entry->cdrname, &colptr, colbuf, sizeof(colbuf), 0, datefield ? 0 : 1);
static void curlds_free(void *data)
{
AST_LIST_HEAD(global_curl_info, curl_settings) *list = data;
- struct curl_settings *cur;
+ struct curl_settings *setting;
if (!list) {
return;
}
- while ((cur = AST_LIST_REMOVE_HEAD(list, list))) {
- free(cur);
+ while ((setting = AST_LIST_REMOVE_HEAD(list, list))) {
+ free(setting);
}
AST_LIST_HEAD_DESTROY(list);
}
int res;
SQLINTEGER err;
short int mlen;
- unsigned char msg[200], stat[10];
+ unsigned char msg[200], state[10];
/* Nothing to disconnect */
if (!obj->con) {
obj->con = NULL;
ast_log(LOG_DEBUG, "Database handle deallocated\n");
} else {
- SQLGetDiagRec(SQL_HANDLE_DBC, obj->con, 1, stat, &err, msg, 100, &mlen);
+ SQLGetDiagRec(SQL_HANDLE_DBC, obj->con, 1, state, &err, msg, 100, &mlen);
ast_log(LOG_WARNING, "Unable to deallocate database handle? %d errno=%d %s\n", res, (int)err, msg);
}