[ostree] main: Fix a format string error



commit d596615babe445a8a91d802e949afbb1215c676f
Author: Colin Walters <walters verbum org>
Date:   Wed Jun 27 20:25:56 2012 -0400

    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 b416ec9..d4d1d5b 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 789b223..d9e2601 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 c96ed3b..ff16b16 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);
 	}
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]