Seg Fault while using /dev/clipboard

Dave Korn dave.korn@artimi.com
Fri Mar 4 18:03:00 GMT 2005


----Original Message----
>From: Dave Korn
>Sent: 04 March 2005 17:27

> ----Original Message----
>> From: Dave Korn
>> Sent: 04 March 2005 17:14
> 
>>   UINT format;
> 
>>       if ((format = GetPriorityClipboardFormat (formatlist, 2)) <= 0)
> 
> 
>   LOL!


  Dunno why the compiler didn't warn.  This seems to fix it ok.  Attached as
well, in case of line wrap.


dk@mace /usr/build/src> cat /dev/clipboard
dk@mace /usr/build/src> echo $?
0
dk@mace /usr/build/src>

Index: winsup/cygwin/fhandler_clipboard.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/fhandler_clipboard.cc,v
retrieving revision 1.27
diff -p -u -r1.27 fhandler_clipboard.cc
--- winsup/cygwin/fhandler_clipboard.cc 1 Mar 2005 11:51:28 -0000       1.27
+++ winsup/cygwin/fhandler_clipboard.cc 4 Mar 2005 17:31:45 -0000
@@ -198,7 +198,7 @@ fhandler_dev_clipboard::read (void *ptr,
       formatlist[0] = cygnativeformat;
       formatlist[1] = current_codepage == ansi_cp ? CF_TEXT : CF_OEMTEXT;
       OpenClipboard (0);
-      if ((format = GetPriorityClipboardFormat (formatlist, 2)) <= 0)
+      if ((int)(format = GetPriorityClipboardFormat (formatlist, 2)) <= 0)
        {
          CloseClipboard ();
 #if 0

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-clip-bug.diff
Type: application/octet-stream
Size: 758 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20050304/887c14e2/attachment.obj>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list