<html>
<head>
<base href="https://bugzilla.icculus.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:smcv-ioquake3@pseudorandom.co.uk" title="Simon McVittie <smcv-ioquake3@pseudorandom.co.uk>"> <span class="fn">Simon McVittie</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Com_sprintf not working properly"
href="https://bugzilla.icculus.org/show_bug.cgi?id=5944">bug 5944</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>smcv-ioquake3@pseudorandom.co.uk
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Com_sprintf not working properly"
href="https://bugzilla.icculus.org/show_bug.cgi?id=5944#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Com_sprintf not working properly"
href="https://bugzilla.icculus.org/show_bug.cgi?id=5944">bug 5944</a>
from <span class="vcard"><a class="email" href="mailto:smcv-ioquake3@pseudorandom.co.uk" title="Simon McVittie <smcv-ioquake3@pseudorandom.co.uk>"> <span class="fn">Simon McVittie</span></a>
</span></b>
<pre>Com_sprintf() is basically ISO C (v)snprintf(), which doesn't allow this usage:
C99 and POSIX.1-2001 specify that the results are undefined if a call
to sprintf(), snprintf(), vsprintf(), or vsnprintf() would cause copy‐
ing to take place between objects that overlap (e.g., if the target
string array and one of the supplied input arguments refer to the same
buffer).
If you're writing native code (stuff that ends up in the engine, or
cgame/qagame/ui compiled to native code) then Com_sprintf() is just a wrapper
around (v)snprintf(). If you're writing bytecode (cgame.qvm, qagame.qvm,
ui.qvm), the implementation used is in bg_lib.c.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>