From 4ecbb3552147a3c867cbce47a7e2714b1a84c098 Mon Sep 17 00:00:00 2001 From: Kolja Waschk Date: Sat, 15 Dec 2007 22:02:10 +0000 Subject: [PATCH] Cosmetics and fix for segfault after legacy check in cable.c git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@849 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/src/cmd/cable.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/jtag/src/cmd/cable.c b/jtag/src/cmd/cable.c index 2b7deb54..481a2f1b 100644 --- a/jtag/src/cmd/cable.c +++ b/jtag/src/cmd/cable.c @@ -54,19 +54,17 @@ cmd_cable_run( char *params[] ) if (parport_drivers[i] != 0) { /* Old syntax was used. Swap params. */ - char *tmparam; printf( _("Note: the 'cable' command syntax changed, please read the help text\n") ); if (paramc >= 4) { + char *tmparam; tmparam = params[3]; params[3] = params[2]; + params[2] = params[1]; + params[1] = tmparam; } - else if (paramc >= 3) - { - char *tmparam = params[2]; - }; - params[2] = params[1]; - params[1] = tmparam; + else + return -1; } /* search cable driver list */