mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-26 09:16:48 +00:00
Modernize code base
This commit is contained in:
@@ -388,7 +388,7 @@ void write_zero(int fd, size_t size) {
|
||||
lseek(fd, pos + size, SEEK_SET);
|
||||
}
|
||||
|
||||
int file_to_array(const char *filename, Array<char *> &arr) {
|
||||
int file_to_array(const char *filename, Array<CharArray> &arr) {
|
||||
if (access(filename, R_OK) != 0)
|
||||
return 1;
|
||||
char *line = nullptr;
|
||||
@@ -404,8 +404,8 @@ int file_to_array(const char *filename, Array<char *> &arr) {
|
||||
if (line[read - 1] == '\n')
|
||||
line[read - 1] = '\0';
|
||||
arr.push_back(line);
|
||||
line = nullptr;
|
||||
}
|
||||
fclose(fp);
|
||||
free(line);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user