mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Avoid truncatted NULL ternminator gcc warning
This prevents gcc warnings: warning: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute While there is "nonstring" attribute, clang does not support it, so this is the simplest solution.
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
/* https://tools.ietf.org/html/rfc4648#section-4 */
|
/* https://tools.ietf.org/html/rfc4648#section-4 */
|
||||||
static char base64char(int x)
|
static char base64char(int x)
|
||||||
{
|
{
|
||||||
static const char table[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
static const char table[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||||
"abcdefghijklmnopqrstuvwxyz"
|
"abcdefghijklmnopqrstuvwxyz"
|
||||||
"0123456789+/";
|
"0123456789+/";
|
||||||
return table[x & 63];
|
return table[x & 63];
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ static void wipeSpecial(char *buffer, size_t buffer_size, unsigned int turn)
|
|||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
unsigned char write_modes[][3] = {
|
const unsigned char write_modes[27][4] = {
|
||||||
{"\x55\x55\x55"}, {"\xaa\xaa\xaa"}, {"\x92\x49\x24"},
|
{"\x55\x55\x55"}, {"\xaa\xaa\xaa"}, {"\x92\x49\x24"},
|
||||||
{"\x49\x24\x92"}, {"\x24\x92\x49"}, {"\x00\x00\x00"},
|
{"\x49\x24\x92"}, {"\x24\x92\x49"}, {"\x00\x00\x00"},
|
||||||
{"\x11\x11\x11"}, {"\x22\x22\x22"}, {"\x33\x33\x33"},
|
{"\x11\x11\x11"}, {"\x22\x22\x22"}, {"\x33\x33\x33"},
|
||||||
|
|||||||
Reference in New Issue
Block a user