mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-10 03:48:34 +00:00
app_queue: Silence GCC 8 compiler warning
I'm only seeing an error in 14+, so I assume it is due to different
compiler options:
app_queue.c: In function ‘handle_queue_add_member’:
app_queue.c:10234:19: error: ‘%d’ directive writing between 1 and 11
bytes into a region of size 3 [-Werror=format-overflow=]
sprintf(num, "%d", state);
^~
app_queue.c:10234:18: note: directive argument in the range
[-2147483648, 99]
sprintf(num, "%d", state);
^~~~
Compiler: gcc version 8.0.1 20180414 (experimental)
[trunk revision 259383] (Ubuntu 8-20180414-1ubuntu2)
Change-Id: I18577590da46829c1ea7d8b82e41d69f105baa10
This commit is contained in:
@@ -9932,7 +9932,7 @@ static char *complete_queue_add_member(const char *line, const char *word, int p
|
||||
case 6: /* only one possible match, "penalty" */
|
||||
return state == 0 ? ast_strdup("penalty") : NULL;
|
||||
case 7:
|
||||
if (state < 100) { /* 0-99 */
|
||||
if (0 <= state && state < 100) { /* 0-99 */
|
||||
char *num;
|
||||
if ((num = ast_malloc(3))) {
|
||||
sprintf(num, "%d", state);
|
||||
|
||||
Reference in New Issue
Block a user