diff options
author | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2017-09-17 20:00:27 +0200 |
---|---|---|
committer | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2017-09-17 20:00:27 +0200 |
commit | d276a2199fa5ca02e8d7e4a4d4c952ca008485e5 (patch) | |
tree | 00a150cf87b469ec4b1da9752fed5a893753d39e | |
parent | f0cfe69d4fc5b0d209d608d9a1661f23714c20d7 (diff) | |
download | ratpoison-d276a2199fa5ca02e8d7e4a4d4c952ca008485e5.zip |
Simplify ratpoison -c realloc loop
-rw-r--r-- | src/main.c | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -331,18 +331,8 @@ main (int argc, char *argv[]) print_version (); break; case 'c': - if (!cmd) - { - cmd = xmalloc (sizeof(char *)); - cmd_count = 0; - } - else - { - cmd = xrealloc (cmd, sizeof (char *) * (cmd_count + 1)); - } - - cmd[cmd_count] = xstrdup (optarg); - cmd_count++; + cmd = xrealloc (cmd, sizeof (char *) * (cmd_count + 1)); + cmd[cmd_count++] = xstrdup (optarg); break; case 'd': display = optarg; |