From: Eric Bollengier Date: Thu, 4 Feb 2021 10:31:27 +0000 (+0100) Subject: Fix windows compilation X-Git-Tag: Release-11.0.2~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7fd5593a9db953c32bcb61b6186b7d514a97225;p=thirdparty%2Fbacula.git Fix windows compilation --- diff --git a/bacula/src/findlib/drivetype.c b/bacula/src/findlib/drivetype.c index c6d21bfca..2d8866233 100644 --- a/bacula/src/findlib/drivetype.c +++ b/bacula/src/findlib/drivetype.c @@ -57,9 +57,8 @@ bool drivetype(const char *fname, char *dt, int dtlen) CHAR rootpath[4]; UINT type; - /* Copy Drive Letter, colon, and backslash to rootpath */ - bstrncpy(rootpath, fname, 3); - rootpath[3] = '\0'; + /* Copy Drive Letter, colon, and backslash to rootpath. bstrncpy will null-terminate the string */ + bstrncpy(rootpath, fname, sizeof(rootpath)); type = GetDriveType(rootpath);