[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Introduce get_datafile_dir() to replace bios_di
From: |
M. Warner Losh |
Subject: |
Re: [Qemu-devel] [PATCH] Introduce get_datafile_dir() to replace bios_dir |
Date: |
Thu, 26 Feb 2009 09:53:46 -0700 (MST) |
In message: <address@hidden>
Anthony Liguori <address@hidden> writes:
: 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().
Better performance to, but I doubt that would matter here...
Warner