Security warnings with Visual Studio 2005
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
Visual Studio warns that the following C library methods have been deprecated because they lead to insecure code:
strcpy, strcat, strncat, strerror, strtok sprintf, fscanf, sscanf, scanf asctime, ctime, gmtime, localtime fopen, setbuf, gets, getw, putw tmpnam
Most of these are methods that we use rarely, if ever. The only really troublesome one is strcpy. Replacing it with strncpy is a bad idea, because strncpy leaves overlength strings unterminated.
Usually strcpy is used to duplicate strings: in many places in VTK code, a new char[] is allocated, and the old string is copied into it. We could write a vtkCreateDuplicateString() method that will do this without strcpy.