Skip to content

Commit

Permalink
Merge pull request #4 from myss/master
Browse files Browse the repository at this point in the history
Problem in malloc
  • Loading branch information
xuhdev committed Apr 27, 2014
2 parents ef72bc7 + d90549a commit d121a1a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/bin/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ int main(int argc, const char* argv[])
/* If there are other args left, regard them as file names */

path_count = argc - i;
file_paths = (char**) malloc(path_count * sizeof(char**));
file_paths = (char**) malloc(path_count * sizeof(char*));

for (; i < argc; ++i) {
file_paths[path_count + i - argc] = strdup(argv[i]);
Expand Down Expand Up @@ -175,7 +175,6 @@ int main(int argc, const char* argv[])

if (!strcmp(full_filename, "-")) {
int len;
int c;

/* Read a line from stdin. If EOF encountered, continue */
if (!fgets(file_line_buffer, FILENAME_MAX + 1, stdin)) {
Expand Down

0 comments on commit d121a1a

Please sign in to comment.