From: Kern Sibbald Date: Tue, 8 Dec 2009 08:36:31 +0000 (+0100) Subject: Add bstrncat comments X-Git-Tag: Release-7.0.0~2492 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=06ca4acd984b7c92916080ec7a205f8608e8b703;p=bacula%2Fbacula Add bstrncat comments --- diff --git a/bacula/src/lib/bsys.c b/bacula/src/lib/bsys.c index 7527ec4122..730999310f 100644 --- a/bacula/src/lib/bsys.c +++ b/bacula/src/lib/bsys.c @@ -105,7 +105,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); @@ -116,9 +115,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);