mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 20:11:47 +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)
|
if (! hms)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (HMS_do(hms))
|
boolean ok = HMS_do(hms);
|
||||||
|
|
||||||
|
if (ok)
|
||||||
{
|
{
|
||||||
char *p = strstr(hms->buffer, "\n\n");
|
char *p = strstr(hms->buffer, "\n\n");
|
||||||
|
|
||||||
|
|
@ -542,6 +544,9 @@ HMS_fetch_rules (char *buffer, size_t buffer_size)
|
||||||
|
|
||||||
HMS_end(hms);
|
HMS_end(hms);
|
||||||
|
|
||||||
|
if (!ok)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue