diff options
author | Erich Eckner <git@eckner.net> | 2019-03-10 20:49:26 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-03-10 20:49:26 +0100 |
commit | f89d187224290e846062524bab57100e67884c16 (patch) | |
tree | 569e0a0d1e62ef43a682100c462d4ed3e3444689 /input_gadgets.c | |
parent | 93eba0ed9b902e95027a512d326d9c62464b85d7 (diff) | |
download | anzeige-f89d187224290e846062524bab57100e67884c16.tar.xz |
input_gadgets.c: print train if CURLE_COULDNT_RESOLVE_HOST, exit 1 else
Diffstat (limited to 'input_gadgets.c')
-rw-r--r-- | input_gadgets.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/input_gadgets.c b/input_gadgets.c index d598f84..f805ee6 100644 --- a/input_gadgets.c +++ b/input_gadgets.c @@ -171,7 +171,12 @@ char *gadgets_retrieve_current_temperature(char *output, int max_len) curl_easy_strerror(res) ); free(chunk.memory); - return NULL; + if (res != CURLE_COULDNT_RESOLVE_HOST) + return NULL; + char *ende = output; + if (max_len > 0) + ende += snprintf(ende, max_len, "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", 0xEE, 0x01, 0xEE, 0x02, 0xEE, 0x01, 0xEE, 0x02, 0xEE, 0x05, 0xEE, 0x06, 0xEE, 0x05, 0xEE, 0x06); + return ende; } regex_t re; @@ -287,7 +292,12 @@ char *gadgets_retrieve_weather_forecast(char *output, int max_len) curl_easy_strerror(res) ); free(chunk.memory); - return NULL; + if (res != CURLE_COULDNT_RESOLVE_HOST) + return NULL; + char *ende = output; + if (max_len > 0) + ende += snprintf(ende, max_len, "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", 0xEE, 0x01, 0xEE, 0x02, 0xEE, 0x01, 0xEE, 0x02, 0xEE, 0x05, 0xEE, 0x06, 0xEE, 0x05, 0xEE, 0x06); + return ende; } LIBXML_TEST_VERSION @@ -410,7 +420,12 @@ char *gadgets_retrieve_weather_warnings(char *output, int max_len) curl_easy_strerror(res) ); free(chunk.memory); - return NULL; + if (res != CURLE_COULDNT_RESOLVE_HOST) + return NULL; + char *ende = output; + if (max_len > 0) + ende += snprintf(ende, max_len, "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", 0xEE, 0x01, 0xEE, 0x02, 0xEE, 0x01, 0xEE, 0x02, 0xEE, 0x05, 0xEE, 0x06, 0xEE, 0x05, 0xEE, 0x06); + return ende; } /* FILE *f = fopen("Z_CAP_C_EDZW_LATEST_PVW_STATUS_PREMIUMDWD_COMMUNEUNION_DE.zip","rb"); |