dnd_flower_message.x_offset = dnd_drag->x_offset;
dnd_flower_message.y_offset = dnd_drag->y_offset;
- write(fd, &dnd_flower_message, sizeof dnd_flower_message);
+ if (write(fd, &dnd_flower_message, sizeof dnd_flower_message) < 0)
+ abort();
+
close(fd);
}
{
int p[2];
- pipe2(p, O_CLOEXEC);
+ if (pipe2(p, O_CLOEXEC) == -1)
+ return;
+
wl_data_offer_receive(offer->offer, mime_type, p[1]);
close(p[1]);
{
FILE *fp = png_get_io_ptr(png);
- if (fread(data, 1, size, fp) < 0)
+ if (fread(data, 1, size, fp) != size)
png_error(png, NULL);
}
if (fp == NULL)
return NULL;
- fread(header, sizeof header, 1, fp);
+ if (fread(header, sizeof header, 1, fp) != 1)
+ return NULL;
+
rewind(fp);
for (i = 0; i < ARRAY_LENGTH(loaders); i++) {
if (memcmp(header, loaders[i].header,