提交 3cc3816f 编写于 作者: H Herbert Xu 提交者: David S. Miller

[CRYPTO]: Kill unnecessary strncpy from tcrypt

It seems that bad code tends to get copied (see test_cipher_speed).  So let's
kill this idiom before it spreads any further.
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ef2736fc
...@@ -266,16 +266,16 @@ static void test_cipher(char *algo, int mode, int enc, ...@@ -266,16 +266,16 @@ static void test_cipher(char *algo, int mode, int enc,
char *key; char *key;
struct cipher_testvec *cipher_tv; struct cipher_testvec *cipher_tv;
struct scatterlist sg[8]; struct scatterlist sg[8];
char e[11], m[4]; const char *e, *m;
if (enc == ENCRYPT) if (enc == ENCRYPT)
strncpy(e, "encryption", 11); e = "encryption";
else else
strncpy(e, "decryption", 11); e = "decryption";
if (mode == MODE_ECB) if (mode == MODE_ECB)
strncpy(m, "ECB", 4); m = "ECB";
else else
strncpy(m, "CBC", 4); m = "CBC";
printk("\ntesting %s %s %s\n", algo, m, e); printk("\ntesting %s %s %s\n", algo, m, e);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册