lchat

A line oriented chat front end for ii.
git clone git://git.suckless.org/lchat
Log | Files | Refs | README

commit a6a8d970dae07920c68bbb4ca3d8020fa8555b46
parent 9778b6b675462220fa133aa7a13fe8e5d45be6d1
Author: Jan Klemkow <j.klemkow@wemelug.de>
Date:   Sun, 14 Jul 2024 13:34:16 +0200

Avoid useless use of strdup(3).

Diffstat:
Mlchat.c | 12++++--------
1 file changed, 4 insertions(+), 8 deletions(-)

diff --git 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;