Skip to content

Commit

Permalink
Added missing error string rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
makestuff committed Mar 21, 2013
1 parent 6723bd7 commit d4e4fed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xsvf2csvf.c
Expand Up @@ -171,6 +171,7 @@ static FLStatus xsvfSwapBytes(XC *xc, struct Buffer *outBuf, uint32 *maxBufSize,
} else { } else {
// The last mask was not all zeros, so we must honour the XSDRTDO's tdoExpected bytes. // The last mask was not all zeros, so we must honour the XSDRTDO's tdoExpected bytes.
if ( numBytes > BUF_SIZE ) { if ( numBytes > BUF_SIZE ) {
errRender(error, "xsvfSwapBytes(): Previous mask was nonzero, but no room to compare %d bytes", numBytes);
FAIL(FL_UNSUPPORTED_SIZE_ERR); FAIL(FL_UNSUPPORTED_SIZE_ERR);
} }
if ( numBytes > *maxBufSize ) { if ( numBytes > *maxBufSize ) {
Expand Down Expand Up @@ -277,6 +278,7 @@ static FLStatus xsvfSwapBytes(XC *xc, struct Buffer *outBuf, uint32 *maxBufSize,
// there's an attempt to switch the XENDIR state to PAUSE_IR. // there's an attempt to switch the XENDIR state to PAUSE_IR.
thisByte = getNextByte(xc); thisByte = getNextByte(xc);
if ( thisByte ) { if ( thisByte ) {
errRender(error, "xsvfSwapBytes(): Only XENDIR(TAPSTATE_RUN_TEST_IDLE) is supported!");
FAIL(FL_UNSUPPORTED_DATA_ERR); FAIL(FL_UNSUPPORTED_DATA_ERR);
} }
break; break;
Expand All @@ -286,12 +288,14 @@ static FLStatus xsvfSwapBytes(XC *xc, struct Buffer *outBuf, uint32 *maxBufSize,
// there's an attempt to switch the XENDDR state to PAUSE_DR. // there's an attempt to switch the XENDDR state to PAUSE_DR.
thisByte = getNextByte(xc); thisByte = getNextByte(xc);
if ( thisByte ) { if ( thisByte ) {
errRender(error, "xsvfSwapBytes(): Only XENDDR(TAPSTATE_RUN_TEST_IDLE) is supported!");
FAIL(FL_UNSUPPORTED_DATA_ERR); FAIL(FL_UNSUPPORTED_DATA_ERR);
} }
break; break;


default: default:
// All other commands are unsupported, so fail if they're encountered. // All other commands are unsupported, so fail if they're encountered.
errRender(error, "xsvfSwapBytes(): Unsupported command 0x%02X!", thisByte);
FAIL(FL_UNSUPPORTED_CMD_ERR); FAIL(FL_UNSUPPORTED_CMD_ERR);
} }
thisByte = getNextByte(xc); thisByte = getNextByte(xc);
Expand Down

0 comments on commit d4e4fed

Please sign in to comment.