]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/miscfunctions.qc
Add strcpy to reduce explicit use of strzone/strunzone
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / miscfunctions.qc
index ff762e9046fd51d89046dbb196a258d3ef02acec..c905c2773819a8cced544cca36b706d576a5546d 100644 (file)
@@ -306,9 +306,7 @@ void GetCvars_handleString(entity this, entity store, string thisname, float f,
        {
                if (thisname == name)
                {
-                       if (store.(field))
-                               strunzone(store.(field));
-                       store.(field) = strzone(argv(f + 1));
+                       strcpy(store.(field), argv(f + 1));
                }
        }
        else
@@ -323,8 +321,7 @@ void GetCvars_handleString_Fixup(entity this, entity store, string thisname, flo
                        string s = func(this, strcat1(store.(field)));
                        if (s != store.(field))
                        {
-                               strunzone(store.(field));
-                               store.(field) = strzone(s);
+                               strcpy(store.(field), s);
                        }
                }
 }