From e1747e1bac12e3939a3c8707d0482131a48d8845 Mon Sep 17 00:00:00 2001 From: Date: Sun, 8 Dec 2013 15:45:49 -0800 Subject: [PATCH] set mode on output file, and don't clobber existing --- apic-read.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apic-read.cc b/apic-read.cc index ad07b3d..d03287f 100644 --- a/apic-read.cc +++ b/apic-read.cc @@ -41,7 +41,7 @@ main(int argc, char **argv) } AttachedPictureFrame *pic_frame = (AttachedPictureFrame *)frame; TagLib::ByteVector data = pic_frame->picture(); - int fd = open(argv[2], O_CREAT | O_WRONLY); + int fd = open(argv[2], O_CREAT | O_EXCL | O_WRONLY, 0644); if (fd < 0) { perror("open"); return 2; -- 2.56.0