mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-01-05 05:59:23 +01:00
Allow comments in test data files
This commit is contained in:
parent
72ea31b026
commit
26182edd0c
7 changed files with 44 additions and 7 deletions
|
|
@ -140,14 +140,19 @@ int get_line( FILE *f, char *buf, size_t len )
|
|||
{
|
||||
char *ret;
|
||||
|
||||
ret = fgets( buf, len, f );
|
||||
if( ret == NULL )
|
||||
return( -1 );
|
||||
buf[0] = '#';
|
||||
|
||||
if( strlen( buf ) && buf[strlen(buf) - 1] == '\n' )
|
||||
buf[strlen(buf) - 1] = '\0';
|
||||
if( strlen( buf ) && buf[strlen(buf) - 1] == '\r' )
|
||||
buf[strlen(buf) - 1] = '\0';
|
||||
while( buf[0] == '#' )
|
||||
{
|
||||
ret = fgets( buf, len, f );
|
||||
if( ret == NULL )
|
||||
return( -1 );
|
||||
|
||||
if( strlen( buf ) && buf[strlen(buf) - 1] == '\n' )
|
||||
buf[strlen(buf) - 1] = '\0';
|
||||
if( strlen( buf ) && buf[strlen(buf) - 1] == '\r' )
|
||||
buf[strlen(buf) - 1] = '\0';
|
||||
}
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue