Hi,<br>File: dbus-sysdeps-win.c<br><br>Function with code (and comment)<br><br>int _dbus_printf_string_upper_bound (const char *format,<br> va_list args)<br>{<br> /* MSVCRT's vsnprintf semantics are a bit different */
<br> /* The C library source in the Platform SDK indicates that this<br> * would work, but alas, it doesn't. At least not on Windows<br> * 2000. Presumably those sources correspond to the C library on<br> * some newer or even future Windows version.
<br> *<br> len = _vsnprintf (NULL, _DBUS_INT_MAX, format, args);<br> */<br> char p[1024];<br> int len;<br>#ifdef DBUS_WINCE<br> len = _vsnprintf (p, sizeof(p)-1, format, args);<br>#else<br> /* Ok Im using VS 2003 right now with the Server 2k3 R2 PSDSK.
<br> This line was originally len = vsnprintf(p, sizeof(p)-1, format, args);<br> It was failing to compile telling me it was undefined. So Im changing it<br> Michael Luschas May 14th 2007 <a href="mailto:mluschas@gmail.com">
mluschas@gmail.com</a> */<br> len = _vsnprintf (p, sizeof(p)-1, format, args);<br>#endif<br> if (len == -1) // try again<br> {<br> char *p;<br> p = malloc (strlen(format)*3);<br>#ifdef DBUS_WINCE<br> len = _vsnprintf (p, sizeof(p)-1, format, args);
<br>#else <br> /*Same as previous comment */<br> len = _vsnprintf (p, sizeof(p)-1, format, args);<br>#endif<br> free(p);<br><br> }<br> return len;<br>}<br><br>// End of code change<br>Not sure where exactly I would submit it (I am knew at this). So I left a comment of WHY I changed it and what it was. I'm not sure if its the
<br>compiler i'm using that made it be that way, or if its the PSDK or what. But thats the change, so im posting it in case anyone else has<br>trouble, or if someone can commit that change (or tell me how to).<br><br>
Thanks<br>