FileAppend of ClipboardAll < 19 bytes gives crash

Report problems with documented functionality
TAC109
Posts: 1129
Joined: 02 Oct 2013, 19:41
Location: New Zealand

FileAppend of ClipboardAll < 19 bytes gives crash

28 Dec 2014, 19:17

Running 32bit ANSI AHK.

Run the following code.

Copy some text to clipboard with Ctrl+C.

If the text is <19 bytes in length, the FileAppend will crash.

Code: Select all

#NoEnv                               ; For performance & future compatibility
#Warn                                ; For catching common errors
SendMode Input                       ; For superior speed and reliability
SetWorkingDir %A_ScriptDir%          ; Ensures a consistent starting directory
; ================================  Program  ===================================
#Persistent
1st:=0
return
OnClipboardChange:
if (1st++)
{ a:=ClipboardAll
  FileAppend %a%, fred               ; If copied text < 19 bytes, crash
}
return
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
lexikos
Posts: 9690
Joined: 30 Sep 2013, 04:07
Contact:

Re: FileAppend of ClipboardAll < 19 bytes gives crash

29 Dec 2014, 03:50

Here's a simplified and more direct test script:

Code: Select all

Clipboard := "foo"
a := ClipboardAll
FileAppend %a%, fred
Thanks for reporting it. It will be fixed soon.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 12 guests