mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
PublicIP / Weather: cleans up states after detection
This commit is contained in:
@@ -70,6 +70,10 @@ const char* ffDetectPublicIp(FFPublicIPOptions* options, FFPublicIpResult* resul
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY response = ffStrbufCreateA(4096);
|
||||
const char* error = ffNetworkingRecvHttpResponse(state, &response);
|
||||
|
||||
*state = (FFNetworkingState){};
|
||||
*status = FF_UNITIALIZED;
|
||||
|
||||
if (error == NULL)
|
||||
ffStrbufSubstrAfterFirstS(&response, "\r\n\r\n");
|
||||
else
|
||||
|
||||
@@ -44,6 +44,10 @@ const char* ffDetectWeather(FFWeatherOptions* options, FFstrbuf* result)
|
||||
|
||||
ffStrbufEnsureFree(result, 4095);
|
||||
const char* error = ffNetworkingRecvHttpResponse(&state, result);
|
||||
|
||||
state = (FFNetworkingState){};
|
||||
status = FF_UNITIALIZED;
|
||||
|
||||
if (error == NULL)
|
||||
{
|
||||
ffStrbufSubstrAfterFirstS(result, "\r\n\r\n");
|
||||
|
||||
Reference in New Issue
Block a user