commit a6a8d970dae07920c68bbb4ca3d8020fa8555b46 Author: Jan Klemkow <j.klem...@wemelug.de> AuthorDate: Sun Jul 14 13:34:16 2024 +0200 Commit: Jan Klemkow <j.klem...@wemelug.de> CommitDate: Sun Jul 14 13:34:16 2024 +0200
Avoid useless use of strdup(3). diff --git a/lchat.c b/lchat.c index 0df653d..6c57ec4 100644 --- a/lchat.c +++ b/lchat.c @@ -196,24 +196,20 @@ main(int argc, char *argv[]) die("strtoull:"); break; case 'i': - if ((in_file = strdup(optarg)) == NULL) - die("strdup:"); + in_file = optarg; break; case 'e': empty_line = true; break; case 'o': - if ((out_file = strdup(optarg)) == NULL) - die("strdup:"); + out_file = optarg; break; case 'p': - if ((prompt = strdup(optarg)) == NULL) - die("strdup:"); + prompt = optarg; prompt_len = strlen(prompt); break; case 't': - if ((title = strdup(optarg)) == NULL) - die("strdup:"); + title = optarg; break; case 'u': ucspi = true;