FreeRDP/winpr/libwinpr/clipboard
ilammy 228916bcec wClipboard: improve error handling
Unify error handling in ClipboardInitFormats() and actually handle the
return value of ClipboardInitSynthesizers(). Currently it always returns
TRUE, but this may change, so we'd better be clean.

Declare 'formatName' in wClipboardFormat as non-const. It is customary
in C to declare owned pointers as non-const because various deallocation
functions like free() take non-const pointers as arguments. Furthermore,
const char* is tightly associated with "string literals" which must not
be freed. Thus declaring this field as non-const is more accurate, and
removes that ugly void* cast from ClipboardInitFormats().

Unify error handling in ClipboardCreate(). The cleanup snippet should
not be repeated as it's prone to errors, like leaking the allocation of
clipboard->formats when ClipboardInitFormats() fails. Unified error
handling makes it much harder to forget resource cleanup on errors.
2017-04-09 03:15:48 +03:00
..
test Fixed tests and dead store warnings. 2017-03-28 16:49:56 +02:00
clipboard.c wClipboard: improve error handling 2017-04-09 03:15:48 +03:00
clipboard.h wClipboard: improve error handling 2017-04-09 03:15:48 +03:00
CMakeLists.txt libwinpr-clipboard: add basic clipboard synthesizers 2014-10-17 18:23:07 -04:00
ModuleOptions.cmake libwinpr-clipboard: initial commit 2014-10-17 15:19:05 -04:00
synthetic.c ctest for int format specifiers and usage doc 2016-12-16 14:20:30 +01:00