Skip to content

Commit

Permalink
ProcMaps: fix bug on parsing device fields
Browse files Browse the repository at this point in the history
CC: "Yao, Yuan" <yuan.yao@intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
  • Loading branch information
Fengguang Wu committed Sep 7, 2018
1 parent 4f7ece0 commit d10cfe4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ProcMaps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "ProcMaps.h"


#if 0
#if 1
static int parse_proc_maps(pid_t pid, std::vector<proc_maps_entry>& maps)
{
char filename[PATH_MAX];
Expand All @@ -27,7 +27,7 @@ static int parse_proc_maps(pid_t pid, std::vector<proc_maps_entry>& maps)

while (fgets(line, sizeof(line), f))
{
ret = sscanf(line, "%lx-%lx %4s %lx %d:%d %lu%*[ ]%n",
ret = sscanf(line, "%lx-%lx %4s %lx %x:%x %lu%*[ ]%n",
&e.start,
&e.end,
e.perms,
Expand Down
2 changes: 1 addition & 1 deletion task-maps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int main(int argc, char *argv[])
auto maps = proc_maps.load(pid);

for (const proc_maps_entry& e: maps)
printf("%lx-%lx %4s %08lx %02d:%02d %-8lu\t\t%s\n",
printf("%lx-%lx %4s %08lx %02x:%02x %-8lu\t\t%s\n",
e.start,
e.end,
e.perms,
Expand Down

0 comments on commit d10cfe4

Please sign in to comment.