On 28 Jan 2009 at 17:34, Mike Christie wrote:

>                         strncat(dev_dir, dent->d_name, FILENAMESZ);


once again: The third argument of strncpy() counts the bytes to be added, not 
bytes that are already there, so the code may not do what some of you seem to 

The alternatives are ugly to implement, like this:
        d = snprintf(cp, cap, "%s", string_of_unknown_lenght);
#ifdef  C99_LIBRARY
        if ( d > cap )
                d = cap;
        if ( d > 0 )
                cp += d, cap -= d;

("cp" being the write position, "cap" the remaining capacity)


You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at http://groups.google.com/group/open-iscsi

Reply via email to