fix missing pointer dereferences, change SerialError to getRS232Error

r2417 | dcl | 2008-04-14 08:40:07 +1000 (Mon, 14 Apr 2008) | 2 lines
This commit is contained in:
Douglas Clowes
2008-04-14 08:40:07 +10:00
parent 0427d9acea
commit 46d79274a5

View File

@@ -47,7 +47,6 @@
#include <modriv.h> #include <modriv.h>
#include <rs232controller.h> #include <rs232controller.h>
#include "lh45util.h" #include "lh45util.h"
#include <serialsinq.h>
#include <unistd.h> #include <unistd.h>
/* -------------------------------------------------------------------------*/ /* -------------------------------------------------------------------------*/
@@ -308,7 +307,7 @@ char *ReplyStart(char *pReply)
//sprintf(self->pAns,"The read value is '%s'\n and the command is: '%s' \n",pReply,pCommand); //sprintf(self->pAns,"The read value is '%s'\n and the command is: '%s' \n",pReply,pCommand);
//return LH45__FAULT; //return LH45__FAULT;
if(pReplyStart == '-'&&strlen(pReplyStart)>7) // Not a number (-XXX.X\r), probably an error response if(*pReplyStart == '-' && strlen(pReplyStart)>7) // Not a number (-XXX.X\r), probably an error response
{ {
strcpy(self->pAns,pReplyStart); strcpy(self->pAns,pReplyStart);
return LH45__BADCOM; return LH45__BADCOM;
@@ -367,7 +366,7 @@ char *ReplyStart(char *pReply)
{ {
return iRet; return iRet;
} }
if(pReplyStart == '-'&&strlen(pReplyStart)>7) // Not a number (-XXX.X\r), probably an error response if(*pReplyStart == '-'&&strlen(pReplyStart)>7) // Not a number (-XXX.X\r), probably an error response
{ {
strcpy(self->pAns,pReplyStart); strcpy(self->pAns,pReplyStart);
return LH45__BADCOM; return LH45__BADCOM;
@@ -431,7 +430,7 @@ char *ReplyStart(char *pReply)
strncpy(pError,pBueffel,iLen); strncpy(pError,pBueffel,iLen);
break; break;
default: default:
SerialError(iCode, pError,iLen); getRS232Error(iCode, pError,iLen);
break; break;
} }
} }