[asan] fix some more format warnings in sysinfo/sysinfo.cc
llvm-svn: 146526
This commit is contained in:
parent
96ed5b6b47
commit
1d337a5e06
|
@ -322,12 +322,13 @@ bool ProcMapsIterator::NextExt(uint64 *start, uint64 *end, char **flags,
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
// for now, assume all linuxes have the same format
|
// for now, assume all linuxes have the same format
|
||||||
if (sscanf(stext_, "%"SCNx64"-%"SCNx64" %4s %"SCNx64" %x:%x %"SCNd64" %n",
|
if (sscanf(stext_, "%"SCNx64"-%"SCNx64" %4s %"SCNx64" %x:%x %"SCNd64" %n",
|
||||||
start ? start : &tmpstart,
|
(unsigned long long *)(start ? start : &tmpstart),
|
||||||
end ? end : &tmpend,
|
(unsigned long long *)(end ? end : &tmpend),
|
||||||
flags_,
|
flags_,
|
||||||
offset ? offset : &tmpoffset,
|
(unsigned long long *)(offset ? offset : &tmpoffset),
|
||||||
&major, &minor,
|
&major, &minor,
|
||||||
inode ? inode : &tmpinode, &filename_offset) != 7) continue;
|
(unsigned long long *)(inode ? inode : &tmpinode),
|
||||||
|
&filename_offset) != 7) continue;
|
||||||
#elif defined(__CYGWIN__) || defined(__CYGWIN32__)
|
#elif defined(__CYGWIN__) || defined(__CYGWIN32__)
|
||||||
// cygwin is like linux, except the third field is the "entry point"
|
// cygwin is like linux, except the third field is the "entry point"
|
||||||
// rather than the offset (see format_process_maps at
|
// rather than the offset (see format_process_maps at
|
||||||
|
@ -396,10 +397,14 @@ bool ProcMapsIterator::NextExt(uint64 *start, uint64 *end, char **flags,
|
||||||
uint64 tmp_anon_pages;
|
uint64 tmp_anon_pages;
|
||||||
|
|
||||||
sscanf(backing_ptr+1, "F %"SCNx64" %"SCNd64") (A %"SCNx64" %"SCNd64")",
|
sscanf(backing_ptr+1, "F %"SCNx64" %"SCNd64") (A %"SCNx64" %"SCNd64")",
|
||||||
file_mapping ? file_mapping : &tmp_file_mapping,
|
(unsigned long long *)(file_mapping ?
|
||||||
file_pages ? file_pages : &tmp_file_pages,
|
file_mapping : &tmp_file_mapping),
|
||||||
anon_mapping ? anon_mapping : &tmp_anon_mapping,
|
(unsigned long long *)(file_pages ?
|
||||||
anon_pages ? anon_pages : &tmp_anon_pages);
|
file_pages : &tmp_file_pages),
|
||||||
|
(unsigned long long *)(anon_mapping
|
||||||
|
? anon_mapping : &tmp_anon_mapping),
|
||||||
|
(unsigned long long *)(anon_pages
|
||||||
|
? anon_pages : &tmp_anon_pages));
|
||||||
// null terminate the file name (there is a space
|
// null terminate the file name (there is a space
|
||||||
// before the first (.
|
// before the first (.
|
||||||
backing_ptr[-1] = 0;
|
backing_ptr[-1] = 0;
|
||||||
|
|
Loading…
Reference in New Issue