ref: 2ebfe03d0d57a4ff315fbd421284e4544fe85922
parent: 6c0673233c7aeeabb0cc5093f7b6712f9a9a7cbe
author: cancel <cancel@cancel.fm>
date: Wed Jan 22 18:12:34 EST 2020
Change to use oso strings for osc hostname/port
--- a/tui_main.c
+++ b/tui_main.c
@@ -2548,7 +2548,7 @@
typedef struct {
Ged ged;
oso *file_name;
- char const *osc_hostname, *osc_port;
+ oso *osc_hostname, *osc_port;
int undo_history_limit;
int softmargin_y, softmargin_x;
int hardmargin_y, hardmargin_x;
@@ -2816,10 +2816,10 @@
break;
}
case Argopt_osc_server:
- t.osc_hostname = optarg;
+ osoput(&t.osc_hostname, optarg);
break;
case Argopt_osc_port:
- t.osc_port = optarg;
+ osoput(&t.osc_port, optarg);
break;
case Argopt_osc_midi_bidule:
midi_mode_deinit(&t.midi_mode);
@@ -2868,8 +2868,8 @@
ged_deinit(&t.ged);
exit(1);
}
- if (t.osc_port != NULL) {
- if (!ged_set_osc_udp(&t.ged, t.osc_hostname, t.osc_port)) {
+ if (t.osc_port) {
+ if (!ged_set_osc_udp(&t.ged, osoc(t.osc_hostname), osoc(t.osc_port))) {
fprintf(stderr, "Failed to set up OSC networking\n");
ged_deinit(&t.ged);
exit(1);
@@ -3828,6 +3828,8 @@
endwin();
ged_deinit(&t.ged);
osofree(t.file_name);
+ osofree(t.osc_hostname);
+ osofree(t.osc_port);
midi_mode_deinit(&t.midi_mode);
#ifdef FEAT_PORTMIDI
if (portmidi_is_initialized)