Improved example + fixed id_ctrl_fd uninitialized
This commit is contained in:
@@ -66,6 +66,8 @@ deserialize_header(int fd, CommentHeader *header)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* TODO: validate driver_data_ptr */
|
||||
|
||||
int
|
||||
unix_fs_driver_leave_comment(void *driver_data_ptr, CommentHeader *header, char *text)
|
||||
{
|
||||
@@ -80,7 +82,7 @@ unix_fs_driver_leave_comment(void *driver_data_ptr, CommentHeader *header, char
|
||||
id_ctrl_file_path = header_file_path = text_file_path = NULL;
|
||||
id_ctrl_file = NULL;
|
||||
|
||||
header_fd = text_fd = -1;
|
||||
header_fd = text_fd = id_ctrl_fd = -1;
|
||||
|
||||
path = ((UnixFsDriverData*) driver_data_ptr)->path;
|
||||
if (!is_valid_directory(path)) {
|
||||
|
Reference in New Issue
Block a user