mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
don't use '%i' at all, since we have no current use cases that need non base-10 parsing (bug #4110)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5533 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -693,7 +693,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
if ((cdl = strstr(transfer, "S("))) {
|
||||
calldurationlimit=atoi(cdl+2);
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "Setting call duration limit to %i seconds.\n",calldurationlimit);
|
||||
ast_verbose(VERBOSE_PREFIX_3 "Setting call duration limit to %d seconds.\n",calldurationlimit);
|
||||
}
|
||||
|
||||
/* Extract DTMF strings to send upon successfull connect */
|
||||
|
@@ -143,8 +143,8 @@ static int disa_exec(struct ast_channel *chan, void *data)
|
||||
ast_log(LOG_WARNING, "disa requires an argument (passcode/passcode file)\n");
|
||||
return -1;
|
||||
}
|
||||
ast_log(LOG_DEBUG, "Digittimeout: %i\n", digittimeout);
|
||||
ast_log(LOG_DEBUG, "Responsetimeout: %i\n", firstdigittimeout);
|
||||
ast_log(LOG_DEBUG, "Digittimeout: %d\n", digittimeout);
|
||||
ast_log(LOG_DEBUG, "Responsetimeout: %d\n", firstdigittimeout);
|
||||
strncpy(tmp, (char *)data, sizeof(tmp)-1);
|
||||
stringp=tmp;
|
||||
strsep(&stringp, "|");
|
||||
|
@@ -114,7 +114,7 @@ static int group_check_exec(struct ast_channel *chan, void *data)
|
||||
|
||||
ast_app_group_split_group(data, limit, sizeof(limit), category, sizeof(category));
|
||||
|
||||
if ((sscanf(limit, "%i", &max) == 1) && (max > -1)) {
|
||||
if ((sscanf(limit, "%d", &max) == 1) && (max > -1)) {
|
||||
count = ast_app_group_get_count(pbx_builtin_getvar_helper(chan, category), category);
|
||||
if (count > max) {
|
||||
if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num))
|
||||
|
@@ -464,7 +464,7 @@ static int conf_cmd(int fd, int argc, char **argv) {
|
||||
/* Show all the users */
|
||||
user = cnf->firstuser;
|
||||
while(user) {
|
||||
ast_cli(fd, "User #: %i Channel: %s %s %s %s %s\n", user->user_no, user->chan->name, (user->userflags & CONFFLAG_ADMIN) ? "(Admin)" : "", (user->userflags & CONFFLAG_MONITOR) ? "(Listen only)" : "", (user->adminflags & ADMINFLAG_MUTED) ? "(Admn Muted)" : "", istalking(user->talking));
|
||||
ast_cli(fd, "User #: %d Channel: %s %s %s %s %s\n", user->user_no, user->chan->name, (user->userflags & CONFFLAG_ADMIN) ? "(Admin)" : "", (user->userflags & CONFFLAG_MONITOR) ? "(Listen only)" : "", (user->adminflags & ADMINFLAG_MUTED) ? "(Admn Muted)" : "", istalking(user->talking));
|
||||
user = user->nextuser;
|
||||
}
|
||||
ast_cli(fd,"%d users in that conference.\n",cnf->users);
|
||||
@@ -535,7 +535,7 @@ static char *complete_confcmd(char *line, char *word, int pos, int state) {
|
||||
/* Search for the user */
|
||||
usr = cnf->firstuser;
|
||||
while(usr) {
|
||||
snprintf(usrno, sizeof(usrno), "%i", usr->user_no);
|
||||
snprintf(usrno, sizeof(usrno), "%d", usr->user_no);
|
||||
if (!strncasecmp(word, usrno, strlen(word))) {
|
||||
if (++which > state)
|
||||
break;
|
||||
@@ -839,7 +839,7 @@ zapretry:
|
||||
"Channel: %s\r\n"
|
||||
"Uniqueid: %s\r\n"
|
||||
"Meetme: %s\r\n"
|
||||
"Usernum: %i\r\n",
|
||||
"Usernum: %d\r\n",
|
||||
chan->name, chan->uniqueid, conf->confno, user->user_no);
|
||||
|
||||
if (!firstpass && !(confflags & CONFFLAG_MONITOR) && !(confflags & CONFFLAG_ADMIN)) {
|
||||
@@ -1047,7 +1047,7 @@ zapretry:
|
||||
"Channel: %s\r\n"
|
||||
"Uniqueid: %s\r\n"
|
||||
"Meetme: %s\r\n"
|
||||
"Usernum: %i\r\n",
|
||||
"Usernum: %d\r\n",
|
||||
chan->name, chan->uniqueid, conf->confno, user->user_no);
|
||||
}
|
||||
if (user->talking && totalsilence > MEETME_DELAYDETECTENDTALK) {
|
||||
@@ -1056,7 +1056,7 @@ zapretry:
|
||||
"Channel: %s\r\n"
|
||||
"Uniqueid: %s\r\n"
|
||||
"Meetme: %s\r\n"
|
||||
"Usernum: %i\r\n",
|
||||
"Usernum: %d\r\n",
|
||||
chan->name, chan->uniqueid, conf->confno, user->user_no);
|
||||
}
|
||||
}
|
||||
@@ -1273,7 +1273,7 @@ outrun:
|
||||
"Channel: %s\r\n"
|
||||
"Uniqueid: %s\r\n"
|
||||
"Meetme: %s\r\n"
|
||||
"Usernum: %i\r\n",
|
||||
"Usernum: %d\r\n",
|
||||
chan->name, chan->uniqueid, conf->confno, user->user_no);
|
||||
prev = NULL;
|
||||
conf->users--;
|
||||
@@ -1340,7 +1340,7 @@ outrun:
|
||||
}
|
||||
}
|
||||
/* Return the number of seconds the user was in the conf */
|
||||
snprintf(meetmesecs, sizeof(meetmesecs), "%i", (int) (time(NULL) - user->jointime));
|
||||
snprintf(meetmesecs, sizeof(meetmesecs), "%d", (int) (time(NULL) - user->jointime));
|
||||
pbx_builtin_setvar_helper(chan, "MEETMESECS", meetmesecs);
|
||||
}
|
||||
free(user);
|
||||
@@ -1451,7 +1451,7 @@ static int count_exec(struct ast_channel *chan, void *data)
|
||||
|
||||
if (localdata && !ast_strlen_zero(localdata)){
|
||||
/* have var so load it and exit */
|
||||
snprintf(val,sizeof(val), "%i",count);
|
||||
snprintf(val,sizeof(val), "%d",count);
|
||||
pbx_builtin_setvar_helper(chan, localdata,val);
|
||||
} else {
|
||||
if (chan->_state != AST_STATE_UP)
|
||||
@@ -1706,7 +1706,7 @@ static struct ast_conf_user* find_user(struct ast_conference *conf, char *caller
|
||||
if (conf && callerident) {
|
||||
user = conf->firstuser;
|
||||
while(user) {
|
||||
snprintf(usrno, sizeof(usrno), "%i", user->user_no);
|
||||
snprintf(usrno, sizeof(usrno), "%d", user->user_no);
|
||||
if (strcmp(usrno, callerident) == 0)
|
||||
return user;
|
||||
user = user->nextuser;
|
||||
|
@@ -150,7 +150,7 @@ static int ospnext_exec(struct ast_channel *chan, void *data)
|
||||
cause = str2cause((char *)data);
|
||||
temp = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
|
||||
result.handle = -1;
|
||||
if (temp && strlen(temp) && (sscanf(temp, "%i", &result.handle) == 1) && (result.handle > -1)) {
|
||||
if (temp && strlen(temp) && (sscanf(temp, "%d", &result.handle) == 1) && (result.handle > -1)) {
|
||||
if ((res = ast_osp_next(&result, cause)) > 0) {
|
||||
char tmp[80];
|
||||
snprintf(tmp, sizeof(tmp), "%d", result.handle);
|
||||
@@ -203,7 +203,7 @@ static int ospfinished_exec(struct ast_channel *chan, void *data)
|
||||
cause = str2cause((char *)data);
|
||||
temp = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
|
||||
result.handle = -1;
|
||||
if (temp && strlen(temp) && (sscanf(temp, "%i", &result.handle) == 1) && (result.handle > -1)) {
|
||||
if (temp && strlen(temp) && (sscanf(temp, "%d", &result.handle) == 1) && (result.handle > -1)) {
|
||||
if (!ast_osp_terminate(result.handle, cause, start, duration)) {
|
||||
pbx_builtin_setvar_helper(chan, "_OSPHANDLE", "");
|
||||
res = 1;
|
||||
|
@@ -119,7 +119,7 @@ static int read_exec(struct ast_channel *chan, void *data)
|
||||
if ((maxdigits<1) || (maxdigits>255)) {
|
||||
maxdigits = 255;
|
||||
} else if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "Accepting a maximum of %i digits.\n", maxdigits);
|
||||
ast_verbose(VERBOSE_PREFIX_3 "Accepting a maximum of %d digits.\n", maxdigits);
|
||||
}
|
||||
if (!(varname) || ast_strlen_zero(varname)) {
|
||||
ast_log(LOG_WARNING, "Invalid! Usage: Read(variable[|filename][|maxdigits][|option][|attempts][|timeout])\n\n");
|
||||
|
@@ -78,7 +78,7 @@ static int readfile_exec(struct ast_channel *chan, void *data)
|
||||
if(len < strlen(returnvar))
|
||||
returnvar[len]='\0';
|
||||
else
|
||||
ast_log(LOG_WARNING,"%s is longer than %i, and %i \n",file,len,strlen(returnvar));
|
||||
ast_log(LOG_WARNING,"%s is longer than %d, and %d \n",file,len,strlen(returnvar));
|
||||
}
|
||||
pbx_builtin_setvar_helper(chan, varname, returnvar);
|
||||
free(returnvar);
|
||||
|
@@ -87,7 +87,7 @@ static int cli_update_realtime(int fd, int argc, char **argv) {
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
ast_cli(fd, "Updated %i RealTime record(s).\n", res);
|
||||
ast_cli(fd, "Updated %d RealTime record(s).\n", res);
|
||||
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
@@ -347,7 +347,7 @@ static int myatoi(char *str)
|
||||
int ret;
|
||||
|
||||
if (str == NULL) return -1;
|
||||
if (sscanf(str,"%i",&ret) != 1) return -1;
|
||||
if (sscanf(str,"%d",&ret) != 1) return -1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -859,7 +859,7 @@ static int last_message_index(char *dir)
|
||||
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
|
||||
goto yuck;
|
||||
}
|
||||
if (sscanf(rowdata, "%i", &x) != 1)
|
||||
if (sscanf(rowdata, "%d", &x) != 1)
|
||||
ast_log(LOG_WARNING, "Failed to read message count!\n");
|
||||
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
|
||||
} else
|
||||
@@ -920,7 +920,7 @@ static int message_exists(char *dir, int msgnum)
|
||||
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
|
||||
goto yuck;
|
||||
}
|
||||
if (sscanf(rowdata, "%i", &x) != 1)
|
||||
if (sscanf(rowdata, "%d", &x) != 1)
|
||||
ast_log(LOG_WARNING, "Failed to read message count!\n");
|
||||
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
|
||||
} else
|
||||
@@ -4072,7 +4072,7 @@ static int vm_newuser(struct ast_channel *chan, struct ast_vm_user *vmu, struct
|
||||
vm_change_password(vmu,newpassword);
|
||||
else
|
||||
vm_change_password_shell(vmu,newpassword);
|
||||
ast_log(LOG_DEBUG,"User %s set password to %s of length %i\n",vms->username,newpassword,(int)strlen(newpassword));
|
||||
ast_log(LOG_DEBUG,"User %s set password to %s of length %d\n",vms->username,newpassword,(int)strlen(newpassword));
|
||||
cmd = ast_play_and_wait(chan,"vm-passchanged");
|
||||
|
||||
/* If forcename is set, have the user record their name */
|
||||
@@ -4174,7 +4174,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
|
||||
vm_change_password(vmu,newpassword);
|
||||
else
|
||||
vm_change_password_shell(vmu,newpassword);
|
||||
ast_log(LOG_DEBUG,"User %s set password to %s of length %i\n",vms->username,newpassword,(int)strlen(newpassword));
|
||||
ast_log(LOG_DEBUG,"User %s set password to %s of length %d\n",vms->username,newpassword,(int)strlen(newpassword));
|
||||
cmd = ast_play_and_wait(chan,"vm-passchanged");
|
||||
break;
|
||||
case '*':
|
||||
|
Reference in New Issue
Block a user