Replace most strdup with gmx_strdup
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / resall.c
index 14e556a8e2c0b99923d56521c79e6987451cdef9..51d9eec7fca95c6f92fe918c820ff5f2fb318b07 100644 (file)
@@ -193,7 +193,7 @@ gmx_bool read_bondeds(int bt, FILE *in, char *line, t_restp *rtp)
         {
             if (sscanf(line+n, "%s%n", str, &ni) == 1)
             {
-                rtp->rb[bt].b[rtp->rb[bt].nb].a[j] = strdup(str);
+                rtp->rb[bt].b[rtp->rb[bt].nb].a[j] = gmx_strdup(str);
             }
             else
             {
@@ -210,7 +210,7 @@ gmx_bool read_bondeds(int bt, FILE *in, char *line, t_restp *rtp)
             n++;
         }
         rtrim(line+n);
-        rtp->rb[bt].b[rtp->rb[bt].nb].s = strdup(line+n);
+        rtp->rb[bt].b[rtp->rb[bt].nb].s = gmx_strdup(line+n);
         rtp->rb[bt].nb++;
     }
     /* give back unused memory */
@@ -450,8 +450,8 @@ void read_resall(char *rrdb, int *nrtpptr, t_restp **rtp,
         {
             gmx_fatal(FARGS, "in .rtp file at line:\n%s\n", line);
         }
-        rrtp[nrtp].resname  = strdup(header);
-        rrtp[nrtp].filebase = strdup(filebase);
+        rrtp[nrtp].resname  = gmx_strdup(header);
+        rrtp[nrtp].filebase = gmx_strdup(filebase);
 
         get_a_line(in, line, STRLEN);
         bError       = FALSE;