mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
HMS_fetch_rules: Return NULL if the curl connection failed, instead of producing garbled rules
This commit is contained in:
parent
782d98fb09
commit
339d368d7d
1 changed files with 6 additions and 1 deletions
|
|
@ -526,7 +526,9 @@ HMS_fetch_rules (char *buffer, size_t buffer_size)
|
|||
if (! hms)
|
||||
return NULL;
|
||||
|
||||
if (HMS_do(hms))
|
||||
boolean ok = HMS_do(hms);
|
||||
|
||||
if (ok)
|
||||
{
|
||||
char *p = strstr(hms->buffer, "\n\n");
|
||||
|
||||
|
|
@ -542,6 +544,9 @@ HMS_fetch_rules (char *buffer, size_t buffer_size)
|
|||
|
||||
HMS_end(hms);
|
||||
|
||||
if (!ok)
|
||||
return NULL;
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue