Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tools/lsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ main (int argc, char *argv[])
while ((c = getopt_long (argc, argv, "s:AclLphvtuU", long_options, &option_index)) >= 0) {
switch (c) {
case 's':
server_name = (char *) malloc (sizeof (char) * strlen(optarg));
server_name = (char *) malloc (sizeof (char) * (strlen(optarg) + 1));
server_name[strlen(optarg)] = '\0';
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following the #88 (comment) comment this line might not be necessary.

Suggested change
server_name[strlen(optarg)] = '\0';

strcpy (server_name, optarg);
options |= JackServerName;
break;
Expand Down