- if (argc >= 1) {
- int len = 1; /* for the '\0' */
- for (; *argv != NULL; argv++) {
- len += strlen(*argv);
- len += 1; /* for the space between the args */
- message = xrealloc(message, len);
- strcat(message, *argv);
- strcat(message, " ");
- }
- message[strlen(message)-1] = '\0';
- } else {
- error_msg_and_die("No message\n");
+ len = 1; /* for the '\0' */
+ message=xcalloc(1, 1);
+ for (i = optind; i < argc; i++) {
+ len += strlen(argv[i]);
+ len += 1; /* for the space between the args */
+ message = xrealloc(message, len);
+ strcat(message, argv[i]);
+ strcat(message, " ");