mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
tests: search for delimiter in bounded buffer
This commit is contained in:
parent
aa75e1f0bf
commit
a06a49b549
@ -717,9 +717,10 @@ struct KMsg : Source {
|
||||
unsigned long t;
|
||||
time_t tt;
|
||||
size_t len;
|
||||
const char *delimiter = strchr(buf, ';');
|
||||
const char *delimiter;
|
||||
|
||||
buf[ *sz ] = 0;
|
||||
delimiter = strchr(buf, ';');
|
||||
|
||||
if ( sscanf( buf, "%u,%u,%lu,-%n", &level, &num, &t, &pos) == 3 ) {
|
||||
if ( delimiter++ && ( delimiter - buf ) > pos )
|
||||
|
Loading…
Reference in New Issue
Block a user