From d596615babe445a8a91d802e949afbb1215c676f Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 27 Jun 2012 20:25:56 -0400 Subject: [PATCH] main: Fix a format string error --- src/ostadmin/ot-admin-main.c | 2 +- src/ostree/ot-main.c | 2 +- src/switchroot/ostree-switch-root.c | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ostadmin/ot-admin-main.c b/src/ostadmin/ot-admin-main.c index b416ec96..d4d1d5b5 100644 --- a/src/ostadmin/ot-admin-main.c +++ b/src/ostadmin/ot-admin-main.c @@ -75,7 +75,7 @@ prep_builtin_argv (const char *builtin, static void set_error_print_usage (GError **error, OtAdminBuiltin *builtins, const char *msg, char **argv) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, msg); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, msg); usage (argv, builtins, TRUE); } diff --git a/src/ostree/ot-main.c b/src/ostree/ot-main.c index 789b2236..d9e26010 100644 --- a/src/ostree/ot-main.c +++ b/src/ostree/ot-main.c @@ -75,7 +75,7 @@ prep_builtin_argv (const char *builtin, static void set_error_print_usage (GError **error, OstreeBuiltin *builtins, const char *msg, char **argv) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, msg); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, msg); usage (argv, builtins, TRUE); } diff --git a/src/switchroot/ostree-switch-root.c b/src/switchroot/ostree-switch-root.c index c96ed3b4..ff16b165 100644 --- a/src/switchroot/ostree-switch-root.c +++ b/src/switchroot/ostree-switch-root.c @@ -203,11 +203,10 @@ main(int argc, char *argv[]) for (i = 0; initramfs_move_mounts[i] != NULL; i++) { const char *path = initramfs_move_mounts[i]; - snprintf (srcpath, sizeof(srcpath), path); snprintf (destpath, sizeof(destpath), "%s/ostree/%s%s", root_mountpoint, ostree_target, path); - if (mount (srcpath, destpath, NULL, MS_MOVE, NULL) < 0) + if (mount (path, destpath, NULL, MS_MOVE, NULL) < 0) { - perrorv ("failed to move mount of %s to %s", srcpath, destpath); + perrorv ("failed to move mount of %s to %s", path, destpath); exit (1); } }