Created the macros PRIzd and PRIzx to deal with MSVC lack of C99.

Thanks to Iain Denniston for pointing it out.
This commit is contained in:
Marcelo Roberto Jimenez
2011-03-11 17:20:17 -03:00
parent 840669b253
commit 3a9ae348bc
3 changed files with 21 additions and 4 deletions

View File

@@ -446,7 +446,7 @@ int http_SendMessage(SOCKINFO *info, int *TimeOut, const char *fmt, ...)
/* Copy CRLF at the end of the chunk */
memcpy(file_buf + num_read, "\r\n", 2);
/* Hex length for the chunk size. */
sprintf(Chunk_Header, "%zx", num_read);
sprintf(Chunk_Header, "%" PRIzx, num_read);
/*itoa(num_read,Chunk_Header,16); */
strcat(Chunk_Header, "\r\n");
/* Copy the chunk size header */
@@ -850,7 +850,7 @@ int http_WriteHttpPost( IN void *Handle,
if (!tempbuf)
return UPNP_E_OUTOF_MEMORY;
/* begin chunk */
sprintf(tempbuf, "%zx\r\n", *size);
sprintf(tempbuf, "%" PRIzx "\r\n", *size);
tempSize = strlen(tempbuf);
memcpy(tempbuf + tempSize, buf, *size);
memcpy(tempbuf + tempSize + *size, "\r\n", 2);