<html>
    <head>
      <base href="https://bugzilla.icculus.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><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">5944</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Com_sprintf not working properly
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>ioquake3
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>GIT MASTER
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>major
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P3
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Misc
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>zachary@ioquake.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>signaljammed@gmail.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>quake3-bugzilla@icculus.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In the following code, copy is built on itself one character at a time from
original. This used to work in an older version of ioq3 from back in 2009, but
now when I use this same method with the latest ioquake3 source code it does
not build upon copy. Instead each time the Com_sprintf call is made what copy
previously had is being overwritten by the *p char. It is almost like it is
ignoring the %s format character in the call. 

char original[1024];
char copy[1024];
char *p;

p = original;
while (1) {
// do some text parsing

// end of line
if (!*p) break;

// All cases above fail so write out the char
Com_sprintf(copy, sizeof(copy), "%s%c", copy, *p);
p++;
}

So if the original text was something like "the fox ran over the hill" then
copy would be the last character in the string 'l'.  It should be an exact
replica of original.</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>