Fixing a sanitizer lint problem that was breaking some builds.
authorWolfgang <wolfgang.pieb@sony.com>
Thu, 26 Mar 2020 01:15:17 +0000 (18:15 -0700)
committerWolfgang <wolfgang.pieb@sony.com>
Thu, 26 Mar 2020 01:26:28 +0000 (18:26 -0700)
compiler-rt/test/tsan/fiber_cleanup.cpp

index a9552d3..5550368 100644 (file)
@@ -26,7 +26,7 @@
 long count_memory_mappings() {
   pid_t my_pid = getpid();
   char proc_file_name[128];
-  snprintf(proc_file_name, 128, "/proc/%ld/maps", my_pid);
+  snprintf(proc_file_name, sizeof(proc_file_name), "/proc/%ld/maps", my_pid);
 
   FILE *proc_file = fopen(proc_file_name, "r");
   long line_count = 0;