You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//An item ID of 0 is illegal. Make sure it doesn't happen.
322
322
if(item==0)
@@ -462,7 +462,7 @@ int copy(struct argblock *pbptr) {
462
462
free(buf);
463
463
464
464
if(err!=noErr) {
465
-
fprintf(stderr, "%s copy: could not copy to pasteboard %s because PasteboardPutItemFlavor returned %li (%s)\n", argv0, make_pasteboardID_cstr(pbptr), err);
465
+
fprintf(stderr, "%s copy: could not copy to pasteboard %s because PasteboardPutItemFlavor returned %li (%s)\n", argv0, make_pasteboardID_cstr(pbptr), (long)err, GetMacOSStatusCommentString(err));
466
466
retval=2;
467
467
}
468
468
@@ -514,9 +514,9 @@ int paste_one(struct argblock *pbptr) {
514
514
515
515
if(err!=noErr) {
516
516
if(err==badPasteboardFlavorErr)
517
-
fprintf(stderr, "%s: could not paste item %u of pasteboard \"%s\": it does not exist in flavor type \"%s\".\n", argv0, pbptr->itemIndex, make_pasteboardID_cstr(pbptr), make_cstr_for_CFStr(pbptr->type, kCFStringEncodingUTF8));
517
+
fprintf(stderr, "%s: could not paste item %lu of pasteboard \"%s\": it does not exist in flavor type \"%s\".\n", argv0, (unsigned long)pbptr->itemIndex, make_pasteboardID_cstr(pbptr), make_cstr_for_CFStr(pbptr->type, kCFStringEncodingUTF8));
518
518
else
519
-
fprintf(stderr, "%s: could not paste item %u of pasteboard \"%s\": PasteboardCopyItemFlavorData (for flavor type \"%s\") returned error %li\n", argv0, pbptr->itemIndex, make_pasteboardID_cstr(pbptr), make_cstr_for_CFStr(pbptr->type, kCFStringEncodingUTF8), (long)err, GetMacOSStatusCommentString(err));
519
+
fprintf(stderr, "%s: could not paste item %lu of pasteboard \"%s\": PasteboardCopyItemFlavorData (for flavor type \"%s\") returned error %li (%s)\n", argv0, (unsigned long)pbptr->itemIndex, make_pasteboardID_cstr(pbptr), make_cstr_for_CFStr(pbptr->type, kCFStringEncodingUTF8), (long)err, GetMacOSStatusCommentString(err));
@@ -541,11 +540,10 @@ int paste(struct argblock *pbptr) {
541
540
pbptr->out_fd=STDOUT_FILENO;
542
541
if(!(pbptr->type))
543
542
pbptr->type=CFRetain(kUTTypeUTF8PlainText);
544
-
if((pbptr->itemIndex) ==0U)
545
-
pbptr->itemIndex=1U;
543
+
if((pbptr->itemIndex) ==0UL)
544
+
pbptr->itemIndex=1UL;
546
545
returnpaste_one(pbptr);
547
546
} else {
548
-
UInt32index=1U;
549
547
structargblockthese_args=*pbptr;
550
548
structargblock*these_args_ptr=&these_args;
551
549
@@ -557,7 +555,7 @@ int paste(struct argblock *pbptr) {
557
555
//If two option values after the paste command collide (e.g. two filenames), paste_one is invoked with the first value, and then we will begin a new set of arguments with the second value.
558
556
//If we get all three option values (filename, type, index), paste_one is invoked, and then we begin a new set of arguments.
0 commit comments