From bdc9dc727b0464bc17bed002d2a701cfc34b777a Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Thu, 11 Feb 2016 19:50:55 +0100 Subject: Add default value for rpcTlsPort Passing NULL to printf and the result to curl may or may not work. YMMV. Fixes #574. --- src/settings.c | 2 +- src/ui.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/settings.c b/src/settings.c index f98874c..f1aa707 100644 --- a/src/settings.c +++ b/src/settings.c @@ -168,7 +168,7 @@ void BarSettingsRead (BarSettings_t *settings) { settings->npStationFormat = strdup ("Station \"%n\" (%i)"); settings->listSongFormat = strdup ("%i) %a - %t%r"); settings->rpcHost = strdup (PIANO_RPC_HOST); - settings->rpcTlsPort = NULL; + settings->rpcTlsPort = strdup ("443"); settings->partnerUser = strdup ("android"); settings->partnerPassword = strdup ("AC7IBG09A3DTSYM4R41UJWL07VLN8JI7"); settings->device = strdup ("android-generic"); diff --git a/src/ui.c b/src/ui.c index 92a91c2..c2a55df 100644 --- a/src/ui.c +++ b/src/ui.c @@ -178,7 +178,11 @@ static CURLcode BarPianoHttpRequest (CURL * const http, const BarSettings_t * const settings, PianoRequest_t * const req) { buffer buffer = {NULL, 0}; sig_atomic_t lint = 0, *prevint; + char url[2048]; + assert (settings->rpcHost != NULL); + assert (settings->rpcTlsPort != NULL); + assert (req->urlPath != NULL); int ret = snprintf (url, sizeof (url), "%s://%s:%s%s", req->secure ? "https" : "http", settings->rpcHost, -- cgit v1.2.3