1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-08 02:03:12 +02:00

Fixed a codemastr(TM) drunk-coding win32 bug

This commit is contained in:
codemastr
2001-11-13 19:38:15 +00:00
parent aed84e3bf0
commit 1a1a4ebd65
2 changed files with 13 additions and 5 deletions
+1
View File
@@ -926,3 +926,4 @@ seen. gmtime warning still there
- Recoded the way the editor menu works (hopefully this is much
better?)
- Added the ability to create new files via the win32 editor
- Fixed a win32 editor bug caused by me being drunk or something :P
+12 -5
View File
@@ -215,15 +215,22 @@ void WipeColors() {
DWORD CALLBACK BufferIt(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb) {
char *buf2;
static long size = 0;
if (!RTFBuf)
size = 0;
buf2 = MyMalloc(size+cb+1);
if (RTFBuf)
memcpy(buf2,RTFBuf,size);
else
size = 0;
memcpy(buf2+size,pbBuff,cb);
size += cb;
MyFree(RTFBuf);
if (RTFBuf)
MyFree(RTFBuf);
RTFBuf = buf2;
pcb = &cb;
return 0;
}
@@ -1087,8 +1094,7 @@ LRESULT CALLBACK FromFileDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPar
else
break;
}
fd = open(file, _O_TRUNC|_O_CREAT|_O_WRONLY|_O_BINARY,_S_IWRITE);
edit.dwCookie = 0;
edit.pfnCallback = BufferIt;
@@ -1096,6 +1102,7 @@ LRESULT CALLBACK FromFileDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPar
SendMessage(GetDlgItem(hDlg, IDC_TEXT), EM_STREAMOUT, (WPARAM)SF_RTF|SFF_PLAINRTF, (LPARAM)&edit);
RTFToIRC(fd, RTFBuf, strlen(RTFBuf));
free(RTFBuf);
RTFBuf = NULL;
EndDialog(hDlg, TRUE);
}
hWnd = GetDlgItem(hDlg, IDC_TEXT);