× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I love tn5250 and am grateful that we have a community of people who
support it. I myself am barely able to walk through the code so I
appreciate the list looking over my shoulder...

I had a long standing bug whereby I would copy some long-ish SQL out of
a Word document and paste it into my tn5250 session and the session
would crash with a Windows message saying that tn5250.exe has stopped
working. I could never put my finger on the exact circumstances, and it
never bothered me that much until recently when I had to do a LOT of these.

So I started digging. Got to win32_paste_text_selection and started
putting in TN5250_LOG() statements. Too busy to learn gdb :-( I
eventually narrowed the error down to the bottom, 'free(pNewBuf);'
Which didn't make much sense to me unless something had inadvertently
stepped on pNewBuf. I'm still not a C programmer despite several hours
of looking at the code (ha!), but the only place it looks like this
routine could possibly step on pNewBuf is up above, where it says 'just
a precaution'.

if (hBuf != NULL) {
size = GlobalSize(hBuf);
size++;
TN5250_LOG (("Windows clipboard size %d\n", size));
pNewBuf = malloc(size);
pBuf = GlobalLock(hBuf);
strncpy(pNewBuf, pBuf, size);
pNewBuf[size] = '\0'; /* just a precaution */
GlobalUnlock(hBuf);
}

I added the line to increment size and my paste problem has gone away.
Take it out, and it returns.

I hope this makes sense.
--buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.