On 17 February 2010 17:54, Christian Costa <titan.costa(a)wanadoo.fr> wrote:
+ if (TRACE_ON(d3d_shader)) + { + int size = strlen(comment) + 1; + char* str = (char*)HeapAlloc(GetProcessHeap(), 0, size); + int i = 0; + char* line = str; + memcpy(str, comment, size); + DPRINTF("//"); + while (i < size) + { + /* Find end of line */ + while ((str[i] != 0) && (str[i] != 0x0a)) + i++; + /* Terminate line and remove preceding 0x0d if any */ + if (i && (str[i-1] == 0x0d)) + str[i-1] = 0; + else + str[i] = 0; + /* Display line and prepare next line */ + DPRINTF("%s\n", debugstr_an(line, strlen(line))); + i++; + line = str + i; + } + } This code has several obvious issues.