|
|
@ -496,10 +496,15 @@ static int acf_sprintf(struct ast_channel *chan, const char *cmd, char *data, ch
|
|
|
|
formatbuf[&arg.format[i] - formatstart + 1] = '\0';
|
|
|
|
formatbuf[&arg.format[i] - formatstart + 1] = '\0';
|
|
|
|
|
|
|
|
|
|
|
|
/* Convert the argument into the required type */
|
|
|
|
/* Convert the argument into the required type */
|
|
|
|
|
|
|
|
if (arg.var[argcount]) {
|
|
|
|
if (sscanf(arg.var[argcount++], "%d", &tmpi) != 1) {
|
|
|
|
if (sscanf(arg.var[argcount++], "%d", &tmpi) != 1) {
|
|
|
|
ast_log(LOG_ERROR, "Argument '%s' is not an integer number for format '%s'\n", arg.var[argcount - 1], formatbuf);
|
|
|
|
ast_log(LOG_ERROR, "Argument '%s' is not an integer number for format '%s'\n", arg.var[argcount - 1], formatbuf);
|
|
|
|
goto sprintf_fail;
|
|
|
|
goto sprintf_fail;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
ast_log(LOG_ERROR, "SPRINTF() has more format specifiers than arguments!\n");
|
|
|
|
|
|
|
|
goto sprintf_fail;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Format the argument */
|
|
|
|
/* Format the argument */
|
|
|
|
snprintf(bufptr, buf + len - bufptr, formatbuf, tmpi);
|
|
|
|
snprintf(bufptr, buf + len - bufptr, formatbuf, tmpi);
|
|
|
@ -514,10 +519,15 @@ static int acf_sprintf(struct ast_channel *chan, const char *cmd, char *data, ch
|
|
|
|
formatbuf[&arg.format[i] - formatstart + 1] = '\0';
|
|
|
|
formatbuf[&arg.format[i] - formatstart + 1] = '\0';
|
|
|
|
|
|
|
|
|
|
|
|
/* Convert the argument into the required type */
|
|
|
|
/* Convert the argument into the required type */
|
|
|
|
|
|
|
|
if (arg.var[argcount]) {
|
|
|
|
if (sscanf(arg.var[argcount++], "%lf", &tmpd) != 1) {
|
|
|
|
if (sscanf(arg.var[argcount++], "%lf", &tmpd) != 1) {
|
|
|
|
ast_log(LOG_ERROR, "Argument '%s' is not a floating point number for format '%s'\n", arg.var[argcount - 1], formatbuf);
|
|
|
|
ast_log(LOG_ERROR, "Argument '%s' is not a floating point number for format '%s'\n", arg.var[argcount - 1], formatbuf);
|
|
|
|
goto sprintf_fail;
|
|
|
|
goto sprintf_fail;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
ast_log(LOG_ERROR, "SPRINTF() has more format specifiers than arguments!\n");
|
|
|
|
|
|
|
|
goto sprintf_fail;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Format the argument */
|
|
|
|
/* Format the argument */
|
|
|
|
snprintf(bufptr, buf + len - bufptr, formatbuf, tmpd);
|
|
|
|
snprintf(bufptr, buf + len - bufptr, formatbuf, tmpd);
|
|
|
@ -562,6 +572,7 @@ static int acf_sprintf(struct ast_channel *chan, const char *cmd, char *data, ch
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
*bufptr = '\0';
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
sprintf_fail:
|
|
|
|
sprintf_fail:
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|