diff options
Diffstat (limited to 'usr.bin/indent/args.c')
-rw-r--r-- | usr.bin/indent/args.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/usr.bin/indent/args.c b/usr.bin/indent/args.c index 631cd9295c9a..f854346d55a6 100644 --- a/usr.bin/indent/args.c +++ b/usr.bin/indent/args.c @@ -294,12 +294,7 @@ found: case KEY: if (*param_start == 0) goto need_param; - { - char *str = strdup(param_start); - if (str == NULL) - err(1, NULL); - add_typename(str); - } + add_typename(param_start); break; case KEY_FILE: @@ -342,7 +337,6 @@ add_typedefs_from_file(const char *str) { FILE *file; char line[BUFSIZ]; - char *copy; if ((file = fopen(str, "r")) == NULL) { fprintf(stderr, "indent: cannot open file %s\n", str); @@ -351,10 +345,7 @@ add_typedefs_from_file(const char *str) while ((fgets(line, BUFSIZ, file)) != NULL) { /* Remove trailing whitespace */ line[strcspn(line, " \t\n\r")] = '\0'; - if ((copy = strdup(line)) == NULL) { - err(1, NULL); - } - add_typename(copy); + add_typename(line); } fclose(file); } |