Fix build failure in view/filter.cpp
authorAlexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
Wed, 15 Jul 2015 23:37:44 +0000 (02:37 +0300)
committerAlexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
Thu, 16 Jul 2015 17:57:23 +0000 (20:57 +0300)
This only happen if you have GMX_X11=ON

Change-Id: I6d8d82985c88d2fb03bfaafc0afa32f0c3483803
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
src/programs/view/filter.cpp

index 84a7df32fc75eb20c38f421ece5376bfabf18086..82d583709f72ccf6dda7bad42d6d90e06692c623 100644 (file)
  */
 #include "gmxpre.h"
 
-#include <string.h>
+#include <cstring>
 
 #include <algorithm>
 
 #include "gromacs/legacyheaders/macros.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/dir_separator.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
@@ -123,10 +124,10 @@ t_dlg *select_filter(t_x11 *x11, t_gmx *gmx)
     char               tmpfile[STRLEN];
     int                i, j, k, len, tlen, ht, ncol, nrow, x0;
 
-    len = strlen(title);
+    len = std::strlen(title);
     for (i = 0; (i < (int)gmx->filter->grps->nr); i++)
     {
-        len = std::max(len, (int)strlen(gmx->filter->grpnames[i]));
+        len = std::max(len, static_cast<int>(std::strlen(gmx->filter->grpnames[i])));
     }
     len += 2;
 
@@ -144,7 +145,7 @@ t_dlg *select_filter(t_x11 *x11, t_gmx *gmx)
     {
         ht = 1+(gmx->filter->grps->nr+1)*2+3;
     }
-    strcpy(tmpfile, "filterXXXXXX");
+    std::strcpy(tmpfile, "filterXXXXXX");
     gmx_tmpnam(tmpfile);
 #ifdef DEBUG
     fprintf(stderr, "file: %s\n", tmpfile);