[Qt-interest] qstrcpy and friends: what are they for?

Andrew Hodgkinson ahodgkinson at endurancetech.co.uk
Mon Jun 7 12:47:39 CEST 2010


On 07/06/2010 11:17, Nikos Chantziaras wrote:

> The only provided hint as to their purpose is "a safe strlen()
> function".  "Safe" as to what?

According to the API documentation, if the string pointer passed to 
qstrlen() is zero (presumably this means NULL), then the function returns 
a length of zero rather than attempting to read data from a silly address 
and interpret that as a string. The other related functions have similar 
features.

-- 
Andrew Hodgkinson, Endurance Technology
Land line: 01223 369 408, mobile: 07855 866 780
Registered Office: 5 Marine Drive West, Bognor Regis, W. Sussex, PO21 2QA



More information about the Qt-interest-old mailing list