public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dietmar Maurer <dietmar@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	 Stefan Reiter <s.reiter@proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup] clean up .bad file handling in sweep_unused_chunks
Date: Thu, 10 Sep 2020 06:37:34 +0200 (CEST)	[thread overview]
Message-ID: <119017407.1091.1599712654842@webmail.proxmox.com> (raw)
In-Reply-To: <20200908130246.8065-1-s.reiter@proxmox.com>

> +                    // filename validity checked in iterator
> +                    let orig_filename = std::ffi::CString::new(&filename.to_bytes()[..64]).unwrap();

As discussed in private, CString::new can never fail here, so unwrap() is safe.

Nethertheless, I prefer:

-    let orig_filename = std::ffi::CString::new(&filename.to_bytes()[..64]).unwrap();
+    let orig_filename = std::ffi::CString::new(&filename.to_bytes()[..64])?;




  reply	other threads:[~2020-09-10  4:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-08 13:02 Stefan Reiter
2020-09-10  4:37 ` Dietmar Maurer [this message]
2020-09-10  4:38 ` [pbs-devel] applied: " Dietmar Maurer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=119017407.1091.1599712654842@webmail.proxmox.com \
    --to=dietmar@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    --cc=s.reiter@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal