mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Network: trim trailing white spaces
This commit is contained in:
@@ -69,5 +69,6 @@ const char* ffDetectPublicIp(FFPublicIpOptions* options, FFPublicIpResult* resul
|
||||
|
||||
ffStrbufDestroy(&result->ip);
|
||||
ffStrbufInitMove(&result->ip, &response);
|
||||
ffStrbufTrimRightSpace(&result->ip);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,11 @@ const char* ffDetectWeather(FFWeatherOptions* options, FFstrbuf* result)
|
||||
|
||||
ffStrbufEnsureFree(result, 4095);
|
||||
bool success = ffNetworkingRecvHttpResponse(&state, result, options->timeout);
|
||||
if (success) ffStrbufSubstrAfterFirstS(result, "\r\n\r\n");
|
||||
if (success)
|
||||
{
|
||||
ffStrbufSubstrAfterFirstS(result, "\r\n\r\n");
|
||||
ffStrbufTrimRightSpace(result);
|
||||
}
|
||||
|
||||
if(!success || result->length == 0)
|
||||
return "Failed to receive the server response";
|
||||
|
||||
Reference in New Issue
Block a user