use energywise_getAttributeFromRowByType function

Document created by cdnadmin on Jan 24, 2014
Version 1Show Document
  • View in full screen mode
This document was generated from CDN thread

Created by: JIN HO LEE on 20-07-2010 10:40:01 AM
When I use under function. I got strange result.
The length is 0 and the returned value is not null.
The returned value is gabage.
Please check this function.
aKeywords =  (char *)energywise_getAttributeFromRowByType(result_row,
            EW_ATTRIBUTE_TYPE_KEYWORDS, &length);

Subject: RE: use energywise_getAttributeFromRowByType function
Replied by: Brock Miller on 21-07-2010 06:20:29 PM
Hi Jin,
In some cases you may get back a valid pointer to memory even when the data length is zero.  The length being zero explicitly means that no data is available for this attribute on this row, hence you should ignore the pointer value passed back.  Please check the length field before checking the data.
In future versions, we can try to modify this to give you NULL pointer in cases like this, but we'd still ask that you validate the length before operating on any data.