message: Refactoring Unsafe Functions (`ispcrt/detail/gpu/GPUDevice.cpp`)
  *   Removed use of `strlen`.
  | `ispcrt/detail/gpu/GPUDevice.cpp`
  *   Formatted source.
  | `ispcrt/detail/gpu/GPUDevice.cpp`
diff: @@ -618,8 +618,9 @@ struct Module : public ispcrt::base::Module {
  const char *userIgcOptionsEnv = getenv_wr(ISPCRT_IGC_OPTIONS);
  if (userIgcOptionsEnv) {
  // Copy at most MAX_ISPCRT_IGC_OPTIONS characters from the env - just to be safe
  - const auto copyChars = std::min(std::strlen(userIgcOptionsEnv), (size_t)MAX_ISPCRT_IGC_OPTIONS);
  - std::string userIgcOptions(userIgcOptionsEnv, copyChars);
  + constexpr auto MAX_ISPCRT_IGC_OPTIONS = 2000UL;
  + const auto numCopyChars = strnlen(userIgcOptionsEnv, MAX_ISPCRT_IGC_OPTIONS);
  + std::string userIgcOptions{userIgcOptionsEnv, numCopyChars};
  if (userIgcOptions.length() >= 3) {
  auto prefix = userIgcOptions.substr(0, 2);
  if (prefix == "+ ") {
  @@ -842,8 +843,8 @@ struct TaskQueue : public ispcrt::base::TaskQueue {
  if (event == nullptr)
  throw std::runtime_error("Failed to create event!");
  try {
  - L0_SAFE_CALL(zeCommandListAppendMemoryCopy(m_cl_compute->handle(), view_dst.devicePtr(), view_src.devicePtr(),
  - size, event->handle(), 0, nullptr));
  + L0_SAFE_CALL(zeCommandListAppendMemoryCopy(m_cl_compute->handle(), view_dst.devicePtr(),
  + view_src.devicePtr(), size, event->handle(), 0, nullptr));
  m_cl_compute->inc();
  } catch (ispcrt::base::ispcrt_runtime_error &e) {
  // cleanup and rethrow
  @@ -1099,7 +1100,6 @@ void linkModules(gpu::Module **modules, const uint32_t numModules) {
  }
  }
  -
  } // namespace gpu
  // Use the first available device by default for now.
  @@ -1239,9 +1239,7 @@ base::MemoryView *GPUContext::newMemoryView(void *appMem, size_t numBytes, bool
  return new gpu::MemoryView((ze_context_handle_t)m_context, nullptr, appMem, numBytes, shared);
  }
  -ISPCRTDeviceType GPUContext::getDeviceType() const {
  - return ISPCRTDeviceType::ISPCRT_DEVICE_TYPE_GPU;
  -}
  +ISPCRTDeviceType GPUContext::getDeviceType() const { return ISPCRTDeviceType::ISPCRT_DEVICE_TYPE_GPU; }
  void *GPUContext::contextNativeHandle() const { return m_context; }
  