Fixed compiler warnings

This commit is contained in:
Andreas Eversberg 2022-09-22 13:21:55 +02:00
parent 822e4e9b11
commit 502a95ada3
1 changed files with 9 additions and 0 deletions

View File

@ -439,7 +439,10 @@ static int generate_dial_string(uint8_t type, const char *dialing, char *string,
}
/* if number is of international type, create international dial string */
if (prefix_1_digit[i]) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-overflow"
sprintf(string, "b%c0%sc", dialing[0], dialing + 1);
#pragma GCC diagnostic pop
return 0;
}
@ -455,7 +458,10 @@ static int generate_dial_string(uint8_t type, const char *dialing, char *string,
}
/* if number is of international type, create international dial string */
if (prefix_2_digit[i]) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-overflow"
sprintf(string, "b%c%c0%sc", dialing[0], dialing[1], dialing + 2);
#pragma GCC diagnostic pop
return 0;
}
@ -465,7 +471,10 @@ static int generate_dial_string(uint8_t type, const char *dialing, char *string,
return -EINVAL;
}
/* if number is of international type, create international dial string */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-overflow"
sprintf(string, "b%c%c%c0%sc", dialing[0], dialing[1], dialing[2], dialing + 3);
#pragma GCC diagnostic pop
return 0;
}