[Qt-interest] bug Qt 4.6-stable in qstrncpy

书名 zhzlfe at foxmail.com
Mon Oct 12 05:23:55 CEST 2009


>"Copies at most len bytes from src"
>-> then I understand you copy len bytes from the src to the dest, right?
>>>stopping at len or the terminating '\0' whichever comes first.
"stopping at len ", exclude “len”. 

"Guarantees that dst is '\0'-terminated"&&"This function assumes that dst is at least len characters long."
-> 
    {
         if (len > 0)

        dst[len-1] = '\0'; 
    }
clear sample.
------------------
LAG




More information about the Qt-interest-old mailing list