made code proper to avoid warning/fixed some small potential bugs
This commit is contained in:
11
nxscript.c
11
nxscript.c
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user