summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/cipher.c
diff options
context:
space:
mode:
authorho <ho@openbsd.org>2000-07-10 16:30:25 +0000
committerho <ho@openbsd.org>2000-07-10 16:30:25 +0000
commit21043e56abc975945d7f92f355c2913a24898cb0 (patch)
tree6fc354b6072393e16bc2844e4f1bf9db120851c9 /usr.bin/ssh/cipher.c
parentGet the correct message on errors. (niels@ ok) (diff)
downloadwireguard-openbsd-21043e56abc975945d7f92f355c2913a24898cb0.tar.xz
wireguard-openbsd-21043e56abc975945d7f92f355c2913a24898cb0.zip
strtok() --> strsep(). (niels@ ok)
Diffstat (limited to 'usr.bin/ssh/cipher.c')
-rw-r--r--usr.bin/ssh/cipher.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/ssh/cipher.c b/usr.bin/ssh/cipher.c
index 97cbd38cae7..a44e51d98a2 100644
--- a/usr.bin/ssh/cipher.c
+++ b/usr.bin/ssh/cipher.c
@@ -12,7 +12,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: cipher.c,v 1.28 2000/06/20 01:39:40 markus Exp $");
+RCSID("$OpenBSD: cipher.c,v 1.29 2000/07/10 16:30:25 ho Exp $");
#include "ssh.h"
#include "cipher.h"
@@ -174,14 +174,15 @@ cipher_name(int cipher)
int
ciphers_valid(const char *names)
{
- char *ciphers;
+ char *ciphers, *cp;
char *p;
int i;
if (names == NULL || strcmp(names, "") == 0)
return 0;
- ciphers = xstrdup(names);
- for ((p = strtok(ciphers, CIPHER_SEP)); p; (p = strtok(NULL, CIPHER_SEP))) {
+ ciphers = cp = xstrdup(names);
+ for ((p = strsep(&cp, CIPHER_SEP)); p && *p != '\0';
+ (p = strsep(&cp, CIPHER_SEP))) {
i = cipher_number(p);
if (i == -1 || !(cipher_mask2() & (1 << i))) {
xfree(ciphers);