Skip to content

intel/measure: silence warning about strncpy usage

LaughingMan requested to merge LingMan/mesa:strncpy into main

intel/measure: silence warning about strncpy usage

GCC 13.2.1 warns:

../src/intel/common/intel_measure.c: In function ‘intel_measure_init’:
../src/intel/common/intel_measure.c:68:7: warning: ‘strncpy’ specified bound 1024 equals destination size [-Wstringop-truncation]
   68 |       strncpy(env_copy, env, 1024);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

The very next line sets the last element of env_copy to \0, so this isn't actually a bug. Simply silence the warning by copying at most 1023 chars.

Merge request reports