mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
Inline printf templates when possible to enable format checking.
This commit is contained in:
1 parent
d88ae4f0a4
commit
5dbde526a8
4 files changed
+24
-23
No files matched your search
@@ -443,17 +443,18 @@ grub_find_device (const char *dir, dev_t dev)
|
||||
/* Found! */
|
||||
char *res;
|
||||
char *cwd;
|
||||
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
/* Convert this block device to its character (raw) device. */
|
||||
const char *template = "%s/r%s";
|
||||
#else
|
||||
/* Keep the device name as it is. */
|
||||
const char *template = "%s/%s";
|
||||
#endif
|
||||
|
||||
cwd = xgetcwd ();
|
||||
res = xmalloc (strlen (cwd) + strlen (ent->d_name) + 3);
|
||||
sprintf (res, template, cwd, ent->d_name);
|
||||
sprintf (res,
|
||||
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
/* Convert this block device to its character (raw) device. */
|
||||
"%s/r%s",
|
||||
#else
|
||||
/* Keep the device name as it is. */
|
||||
"%s/%s",
|
||||
#endif
|
||||
cwd, ent->d_name);
|
||||
strip_extra_slashes (res);
|
||||
free (cwd);
|
||||
|
||||
|
||||
Reference in new issue
Block a user