mirror of
https://github.com/curl/curl.git
synced 2026-08-24 22:13:33 +03:00
checksrc: find bad indentation in conditions without open brace
If the previous line starts with if/while/for AND ends with a closed parenthesis and there's an equal number of open and closed parentheses on that line, verify that this line is indented $indent more steps, if not a cpp line. Also adjust the fall-out from this fix. Closes #11054
This commit is contained in:
parent
31303c34e9
commit
9ce7eee070
17 changed files with 49 additions and 23 deletions
|
|
@ -44,12 +44,12 @@ static int loadfile(const char *filename, void **filedata, size_t *filesize)
|
|||
else
|
||||
datasize = (size_t)cert_tell;
|
||||
if(continue_reading)
|
||||
continue_reading = fseek(fInCert, 0, SEEK_SET) == 0;
|
||||
continue_reading = fseek(fInCert, 0, SEEK_SET) == 0;
|
||||
if(continue_reading)
|
||||
data = malloc(datasize + 1);
|
||||
data = malloc(datasize + 1);
|
||||
if((!data) ||
|
||||
((int)fread(data, datasize, 1, fInCert) != 1))
|
||||
continue_reading = FALSE;
|
||||
((int)fread(data, datasize, 1, fInCert) != 1))
|
||||
continue_reading = FALSE;
|
||||
fclose(fInCert);
|
||||
if(!continue_reading) {
|
||||
free(data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue