]> git.sur5r.net Git - bacula/bacula/commitdiff
Use bstrncpy instead of strncpy
authorMarco van Wieringen <mvw@planets.elm.net>
Tue, 7 Jul 2009 15:42:01 +0000 (17:42 +0200)
committerMarco van Wieringen <mvw@planets.elm.net>
Sun, 9 Aug 2009 11:26:03 +0000 (13:26 +0200)
bacula/src/filed/xattr.c

index 4c52aa8106664b22f60af3a43bbfc6803f8a3b58..5388196217fb4dfbb4231d9fc5c3fb7a98f50ee7 100644 (file)
@@ -672,7 +672,7 @@ static void add_xattr_link_cache_entry(ino_t inum, char *target)
    ptr = (xattr_link_cache_entry_t *)malloc(sizeof(struct xattr_link_cache_entry));
    memset((caddr_t)ptr, 0, sizeof(struct xattr_link_cache_entry));
    ptr->inum = inum;
-   strncpy(ptr->target, target, sizeof(ptr->target));
+   bstrncpy(ptr->target, target, sizeof(ptr->target));
    xattr_link_cache->append(ptr);
 }
 
@@ -1200,11 +1200,11 @@ static bsub_exit_code solaris_save_xattrs(JCR *jcr, const char *xattr_namespace,
          snprintf(current_xattr_namespace, sizeof(current_xattr_namespace), "%s%s/",
                   xattr_namespace, attr_parent);
       } else {
-         strncpy(current_xattr_namespace, "/", sizeof(current_xattr_namespace));
+         bstrncpy(current_xattr_namespace, "/", sizeof(current_xattr_namespace));
       }
    } else {
       name = jcr->last_fname;
-      strncpy(current_xattr_namespace, "/", sizeof(current_xattr_namespace));
+      bstrncpy(current_xattr_namespace, "/", sizeof(current_xattr_namespace));
    }
 
    /*