<div dir="ltr">Thank you for your feedback. I'll adjust the tests with your comments and I'll try to use testbot. </div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/8/8 Dan Kegel <span dir="ltr"><<a href="mailto:dank@kegel.com" target="_blank">dank@kegel.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Minor problem:<br>
<br>
+static void test_strncpy(void)<br>
+{<br>
+    size_t len = 10;<br>
+    char *ret;<br>
+    char dst[len + 1];<br>
<br>
Hmm.  That last line is a VLA, and might not compile in all C<br>
compilers because it's not allowed in C89.<br>
<a href="http://stackoverflow.com/questions/448844/variable-sized-arrays-in-c" target="_blank">http://stackoverflow.com/questions/448844/variable-sized-arrays-in-c</a><br>
Wine seems to want to build in c89 compilers:<br>
<a href="http://www.winehq.org/pipermail/wine-cvs/2011-April/076721.html" target="_blank">http://www.winehq.org/pipermail/wine-cvs/2011-April/076721.html</a><br>
<br>
Try using a #define with a more unique name for the length instead,<br>
or better yet, replace len=10 with len=sizeof(dst)-1 or something.<br>
<br>
Larger problem:<br>
<br>
    ret = strncpy(dst, not_null_less, len);<br>
<br>
This is ill-defined.  You're copying 10 bytes from a 5 byte buffer.<br>
Don't do that.<br>
<br>
Also, passing a not-null-terminated string in as a special test case<br>
doesn't seem interesting... just pass in the longer null-terminated<br>
string, and specify a shorter length.  Fewer test strings needed,<br>
easier to read code.<br>
<br>
Please run 'make check', and test using <a href="http://testbot.winehq.org" target="_blank">http://testbot.winehq.org</a>,<br>
before submitting patches.<br>
</blockquote></div><br></div>