made code proper to avoid warning/fixed some small potential bugs

This commit is contained in:
zolliker
2005-03-04 12:53:07 +00:00
parent 52e8c78aa9
commit 9a94b6dca7
29 changed files with 71 additions and 46 deletions

View File

@@ -29,6 +29,11 @@
#include "udpquieck.h"
#include "nxdict.h"
#include "nxscript.h"
extern char *trim(char *str);
/* missing in nxdict.h: */
NXstatus NXDdefget(NXdict handle, char *pKey, char *pBuffer, int iBufLen);
/*------------------------------------------------------------------------*/
char *makeFilename(SicsInterp *pSics, SConnection *pCon) {
pSicsVariable pPath = NULL, pPref = NULL, pEnd = NULL;
@@ -659,7 +664,7 @@ static void putArray(SConnection *pCon, SicsInterp *pSics,
get array length
*/
status = Tcl_GetInt(tcl,argv[4],&length);
if(status = TCL_OK){
if(status == TCL_OK){
sprintf(buffer,"ERROR: failed to convert %s to integer",argv[4]);
SCWrite(pCon,buffer,eError);
return;
@@ -682,10 +687,10 @@ static void putArray(SConnection *pCon, SicsInterp *pSics,
*/
for(i = 0; i < length; i++){
sprintf(num,"%d",i);
varData = Tcl_GetVar2(tcl,argv[3],num,0);
varData = (char *)Tcl_GetVar2(tcl,argv[3],num,0);
if(varData != NULL){
status = Tcl_GetDouble(tcl,varData,&dVal);
if(status = TCL_OK){
if(status == TCL_OK){
sprintf(buffer,"ERROR: failed to convert %s to double",
varData);
SCWrite(pCon,buffer,eError);