]> granicus.if.org Git - graphviz/commitdiff
gvc: remove a use of the deprecated 'bcopy'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 3 Apr 2022 16:13:35 +0000 (09:13 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 8 Apr 2022 01:45:13 +0000 (18:45 -0700)
As the man page for `bcopy` notes:

  bcopy() was deprecated in IEEE Std 1003.1-2001 (“POSIX.1”) and removed in
  IEEE Std 1003.1-2008 (“POSIX.1”).

lib/gvc/gvconfig.c

index c652306cfbf35fc2dfceb33d4c36f761ae271973..a1c9d4856fca30aab43457db4788f9766766e32d 100644 (file)
@@ -334,7 +334,9 @@ char * gvconfig_libdir(GVC_t * gvc)
                        libdir = line;
                    else
                        libdir = gmalloc(len);
-                   bcopy(p, libdir, ind);
+                   if (ind > 0) {
+                       memmove(libdir, p, ind);
+                   }
                    /* plugins are in "graphviz" subdirectory */
                    strcpy(libdir+ind, "/graphviz");  
                    break;