summaryrefslogtreecommitdiffstats
path: root/kex.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-07-11 17:31:38 +1000
committerDamien Miller <djm@mindrot.org>2000-07-11 17:31:38 +1000
commit3702396526a2569402696ff7d7c6d0fe2e5a447b (patch)
tree3ab056c59cd0c732ec179bd91be88d4e05b087fa /kex.c
parentbc33bd44a2ef165dea1d974fc2d80b822ae08c2a (diff)
- (djm) OpenBSD CVS updates:
- markus@cvs.openbsd.org 2000/06/26 03:22:29 [authfd.c] cleanup, less cut&paste - markus@cvs.openbsd.org 2000/06/26 15:59:19 [servconf.c servconf.h session.c sshd.8 sshd.c] MaxStartups: limit number of unauthenticated connections, work by theo and me - deraadt@cvs.openbsd.org 2000/07/05 14:18:07 [session.c] use no_x11_forwarding_flag correctly; provos ok - provos@cvs.openbsd.org 2000/07/05 15:35:57 [sshd.c] typo - aaron@cvs.openbsd.org 2000/07/05 22:06:58 [scp.1 ssh-agent.1 ssh-keygen.1 sshd.8] Insert more missing .El directives. Our troff really should identify these and spit out a warning. - todd@cvs.openbsd.org 2000/07/06 21:55:04 [auth-rsa.c auth2.c ssh-keygen.c] clean code is good code - deraadt@cvs.openbsd.org 2000/07/07 02:14:29 [serverloop.c] sense of port forwarding flag test was backwards - provos@cvs.openbsd.org 2000/07/08 17:17:31 [compat.c readconf.c] replace strtok with strsep; from David Young <dyoung@onthejob.net> - deraadt@cvs.openbsd.org 2000/07/08 19:21:15 [auth.h] KNF - ho@cvs.openbsd.org 2000/07/08 19:27:33 [compat.c readconf.c] Better conditions for strsep() ending. - ho@cvs.openbsd.org 2000/07/10 10:27:05 [readconf.c] Get the correct message on errors. (niels@ ok) - ho@cvs.openbsd.org 2000/07/10 10:30:25 [cipher.c kex.c servconf.c] strtok() --> strsep(). (niels@ ok)
Diffstat (limited to 'kex.c')
-rw-r--r--kex.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/kex.c b/kex.c
index b0d47b5b..b488090b 100644
--- a/kex.c
+++ b/kex.c
@@ -28,7 +28,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: kex.c,v 1.8 2000/06/20 01:39:41 markus Exp $");
+RCSID("$OpenBSD: kex.c,v 1.9 2000/07/10 16:30:25 ho Exp $");
#include "ssh.h"
#include "ssh2.h"
@@ -287,13 +287,14 @@ char *
get_match(char *client, char *server)
{
char *sproposals[MAX_PROP];
- char *c, *s, *p, *ret;
+ char *c, *s, *p, *ret, *cp, *sp;
int i, j, nproposals;
- c = xstrdup(client);
- s = xstrdup(server);
+ c = cp = xstrdup(client);
+ s = sp = xstrdup(server);
- for ((p = strtok(s, SEP)), i=0; p; (p = strtok(NULL, SEP)), i++) {
+ for ((p = strsep(&sp, SEP)), i=0; p && *p != '\0';
+ (p = strsep(&sp, SEP)), i++) {
if (i < MAX_PROP)
sproposals[i] = p;
else
@@ -301,7 +302,8 @@ get_match(char *client, char *server)
}
nproposals = i;
- for ((p = strtok(c, SEP)), i=0; p; (p = strtok(NULL, SEP)), i++) {
+ for ((p = strsep(&cp, SEP)), i=0; p && *p != '\0';
+ (p = strsep(&cp, SEP)), i++) {
for (j = 0; j < nproposals; j++) {
if (strcmp(p, sproposals[j]) == 0) {
ret = xstrdup(p);