Skip to content

warnings: fix strncpy warnings

Ben Boeckel requested to merge ben.boeckel/vtk:fix-warnings-20180905 into master

GCC is getting smarter and detects that we're not copying the NUL terminator over.

There are two approaches to fixing the warning:

  • where code is already a bit more complicated, just use std::string instead of C-style string manipulations; and
  • where we were doing strncpy(dest, src, strlen(src)), just use strcpy instead since the destination sizes are made based on the size of src anyways.

This fixes warnings which have appeared on megas due to its Fedora 28 update.

Cc: @utkarsh.ayachit @cory.quammen @brad.king @ken-martin

Edited by Ben Boeckel

Merge request reports