Additional error checking when saving the buffer contents

This commit is contained in:
Pierre Pronchery 2013-04-07 01:47:07 +02:00
parent 2f80388251
commit f800a9dc2c

View File

@ -375,7 +375,8 @@ static int _common_task_save_buffer_as(CommonTask * task, char const * filename)
return -_common_task_error(task, strerror(errno), 1);
}
g_free(buf);
fclose(fp);
if(fclose(fp) != 0)
return -_common_task_error(task, strerror(errno), 1);
return 0;
}