examples/CANOpenShell/CANOpenShell.c
changeset 605 f91ee161b3a1
parent 568 84fb13d1b3d2
child 664 a03f0aa7d219
--- a/examples/CANOpenShell/CANOpenShell.c	Mon Oct 05 11:35:40 2009 +0200
+++ b/examples/CANOpenShell/CANOpenShell.c	Thu Oct 08 17:21:15 2009 +0200
@@ -55,7 +55,7 @@
 
 //****************************************************************************
 // GLOBALS
-char BoardBusName[11];
+char BoardBusName[31];
 char BoardBaudRate[5];
 s_BOARD Board = {BoardBusName, BoardBaudRate};
 CO_Data* CANOpenShellOD_Data;
@@ -407,7 +407,7 @@
 					LeaveMutex();
 					return QUIT;
 		case cst_str4('l', 'o', 'a', 'd') : /* Library Interface*/
-					ret = sscanf(command, "load#%100[^,],%10[^,],%4[^,],%d,%d",
+					ret = sscanf(command, "load#%100[^,],%30[^,],%4[^,],%d,%d",
 							LibraryPath,
 							BoardBusName,
 							BoardBaudRate,
@@ -416,10 +416,14 @@
 
 					if(ret == 5)
 					{
+						LeaveMutex();
 						ret = NodeInit(NodeID, NodeType);
-						LeaveMutex();
 						return ret;
 					}
+					else
+					{
+						printf("Invalid load parameters\n");
+					}
 					break;
 		default :
 					help_menu();