diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2005-06-22 16:26:36 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-06-22 16:26:36 -0400 |
commit | 3cc3816f93e3f94f88503da8e6090302fa986bd6 (patch) | |
tree | 4ff87e252277260f589836af0602c8e1fa6a99c4 | |
parent | ef2736fc741316913a457abd3731053071c86241 (diff) |
[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: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | crypto/tcrypt.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 5a95b4a14c2b..85a88a71ff53 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c | |||
@@ -266,16 +266,16 @@ static void test_cipher(char *algo, int mode, int enc, | |||
266 | char *key; | 266 | char *key; |
267 | struct cipher_testvec *cipher_tv; | 267 | struct cipher_testvec *cipher_tv; |
268 | struct scatterlist sg[8]; | 268 | struct scatterlist sg[8]; |
269 | char e[11], m[4]; | 269 | const char *e, *m; |
270 | 270 | ||
271 | if (enc == ENCRYPT) | 271 | if (enc == ENCRYPT) |
272 | strncpy(e, "encryption", 11); | 272 | e = "encryption"; |
273 | else | 273 | else |
274 | strncpy(e, "decryption", 11); | 274 | e = "decryption"; |
275 | if (mode == MODE_ECB) | 275 | if (mode == MODE_ECB) |
276 | strncpy(m, "ECB", 4); | 276 | m = "ECB"; |
277 | else | 277 | else |
278 | strncpy(m, "CBC", 4); | 278 | m = "CBC"; |
279 | 279 | ||
280 | printk("\ntesting %s %s %s\n", algo, m, e); | 280 | printk("\ntesting %s %s %s\n", algo, m, e); |
281 | 281 | ||