Bidi B2 - GetCharacterPlacement order array

David Laight david at l8s.co.uk
Mon Jun 2 11:25:36 CDT 2003


> >>+        if (lpResults->lpOutString)
> >>+            for (i = 0; i < nSet && lpString[i] != 0; ++i)
> >>+                lpResults->lpOutString[i] = lpString[i];
> >>    
> >>
> >
> >What about a strncpy here:

Be aware that strncyp() rarely DTRT, in particular:
- it doesn't guarantee to zero terminate the target
- it is required to zero fill the target buffer
Neither of these is usually desirable.

Many systems have a strlcpy() function which does what you want much
more often.

OTOH is the target buffer can be too short with valid data, they you
need to (typically) dynamically allocate a buffer.

	David

-- 
David Laight: david at l8s.co.uk



More information about the wine-devel mailing list