Fixed bug in setconfig so the function doesn't call copy_to_bap if zero length data.

This commit is contained in:
joellen 2000-01-26 22:25:54 +00:00
parent 835a893074
commit 085bdb8ddd
1 changed files with 6 additions and 2 deletions

View File

@ -301,10 +301,14 @@ int hfa384x_drvr_setconfig(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len)
DBFENTER;
rec.rid = host2hfa384x_16(rid);
rec.reclen = host2hfa384x_16((len/2) + 1); /* note conversion to words, +1 for rid field */
/* write the record header */
result = hfa384x_copy_to_bap( hw, hw->bap, rid, 0, &rec, sizeof(rec));
if (result) goto fail;
result = hfa384x_copy_to_bap( hw, hw->bap, rid, sizeof(rec), buf, len);
if (result) goto fail;
/* write the record data (if there is any) */
if ( len > 0 ) {
result = hfa384x_copy_to_bap( hw, hw->bap, rid, sizeof(rec), buf, len);
if (result) goto fail;
}
result = hfa384x_cmd_access( hw, 1, rid);
fail:
DBFEXIT;