From: Anthony Liguori <aliguori@us.ibm.com>
To: qemu-devel@nongnu.org
Cc: Amit Shah <amit.shah@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] Introduce get_datafile_dir() to replace bios_dir
Date: Thu, 26 Feb 2009 10:37:36 -0600 [thread overview]
Message-ID: <49A6C550.7070005@us.ibm.com> (raw)
In-Reply-To: <1234695809-14967-1-git-send-email-amit.shah@redhat.com>
Amit Shah wrote:
> bios_dir really is $(PREFIX)/share/qemu/ (or the dir. specified by
> -L). It currently stores some firmware images and keymaps, so the
> name bios_dir is really a misnomer.
>
> Replace it with a helper, get_datafile_dir().
>
>
> +static void set_datafile_dir(const char *dir)
> +{
> + strncpy(datafile_dir, dir, sizeof(datafile_dir) - 1);
> + datafile_dir[sizeof(datafile_dir) - 1] = 0;
> +}
>
While this is a safe usage of strncpy(), strncpy() has such weird
semantics that it would be better to just use snprintf().
Regards,
Anthony Liguori
next prev parent reply other threads:[~2009-02-26 16:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-15 11:03 [Qemu-devel] [PATCH] Introduce get_datafile_dir() to replace bios_dir Amit Shah
2009-02-26 16:37 ` Anthony Liguori [this message]
2009-02-26 16:53 ` M. Warner Losh
-- strict thread matches above, loose matches on Subject: below --
2009-02-10 7:56 Amit Shah
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=49A6C550.7070005@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=amit.shah@redhat.com \
--cc=qemu-devel@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).