* On Tue, 4 Jul 2006, Dmitry Timoshkov wrote:
- "Saulius Krasuckas" saulius.krasuckas@ieee.org wrote:
+static void safe_strcatA(char *dst, DWORD dst_len, const char *src) +{
- UINT length;
- char *buff;
- length = lstrlenA(dst);
- length += lstrlenA(src);
- buff = HeapAlloc(GetProcessHeap(), 0, length + 1);
- lstrcpyA(buff, dst);
- lstrcatA(buff, src);
- lstrcpynA(dst, buff, dst_len);
- HeapFree(GetProcessHeap(), 0, buff);
+}
This kind of "safe" wrappers doesn't makes the code be safer in reality, needlessly clobbering the code instead.
By "safe" I meant it doesn't overflow buffer. Does it do? But well, would your reactions was the the same if I'd called this local_strcatA(), uhm?