]> git.sur5r.net Git - bacula/bacula/commitdiff
Add bstrncat comments
authorKern Sibbald <kern@sibbald.com>
Tue, 8 Dec 2009 08:36:31 +0000 (09:36 +0100)
committerKern Sibbald <kern@sibbald.com>
Tue, 8 Dec 2009 13:34:40 +0000 (14:34 +0100)
bacula/src/lib/bsys.c

index 9d1a7ca6b1e08e47a0e421125cc382c84136a76b..ca95240533b53d7ec78941fd796eef64125a8877 100644 (file)
@@ -115,7 +115,6 @@ char *bstrncpy(char *dest, POOL_MEM &src, int maxlen)
    return dest;
 }
 
-
 char *bstrncat(char *dest, const char *src, int maxlen)
 {
    int len = strlen(dest);
@@ -126,9 +125,13 @@ char *bstrncat(char *dest, const char *src, int maxlen)
    return dest;
 }
 
+/*
+ * Note: Here the maxlen is the maximum length permitted
+ *  stored in dest, while on Unix systems, it is the maximum characters
+ *  that may be copied from src.
+ */
 char *bstrncat(char *dest, POOL_MEM &src, int maxlen)
 {
-
    int len = strlen(dest);
    if (len < maxlen-1) {
       strncpy(dest+len, src.c_str(), maxlen-len-1);