]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix bad Windows strncpy again ...
authorKern Sibbald <kern@sibbald.com>
Thu, 2 May 2019 13:58:20 +0000 (15:58 +0200)
committerKern Sibbald <kern@sibbald.com>
Thu, 2 May 2019 13:58:20 +0000 (15:58 +0200)
bacula/src/win32/filed/plugins/bpipe-fd.c

index 7e86adb60b6863164986217ddb653a088ed02cad..6e5ea8bea14d87a537b18bb5bf8352ca0d65cb50 100644 (file)
@@ -443,10 +443,10 @@ static bRC endRestoreFile(bpContext *ctx)
  */
 static bRC createFile(bpContext *ctx, struct restore_pkt *rp)
 {
-// printf("bpipe-fd: createFile\n");
    if (strlen(rp->where) >= sizeof(plugin_ctx::where)) {
-      printf("Restore target dir too long. Restricting to first %d bytes.\n",
-         sizeof(plugin_ctx::where));
+      /* Note: this really should fail Bacula!!! */
+      printf("Restore where directory name too long. Restricting to first %d bytes.\n",
+         (int)sizeof(plugin_ctx::where)-1);
    }
    strncpy(((struct plugin_ctx *)ctx->pContext)->where, rp->where,
       sizeof(plugin_ctx::where));