Network: trim trailing white spaces

This commit is contained in:
李通洲 committed 2024-03-19 21:18:25 +08:00
1 parent 7c5eb021ee
commit 66bef2fc19
2 files changed
+6 -1

No files matched your search

+1
View File
@@ -69,5 +69,6 @@ const char* ffDetectPublicIp(FFPublicIpOptions* options, FFPublicIpResult* resul
ffStrbufDestroy(&result->ip);
ffStrbufInitMove(&result->ip, &response);
ffStrbufTrimRightSpace(&result->ip);
return NULL;
}
+5 -1
View File
@@ -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";