discover: Fix raw string argument to talloc_asprintf_append
authorJeremy Kerr <jk@ozlabs.org>
Fri, 26 Jun 2015 03:41:46 +0000 (11:41 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Fri, 26 Jun 2015 03:41:46 +0000 (11:41 +0800)
Current builds give a warning:

  ../discover/platform-powerpc.c: In function ‘update_bootdev_config’:
  ../discover/platform-powerpc.c:667:4: warning: format not a string
  literal and no format arguments [-Wformat-security]
      tmp = val = talloc_asprintf_append(val, boot_str);
          ^

This change uses "%s" for the format string.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/platform-powerpc.c

index b4f2a771f64ce6b8016025860ded536a901ded1f..2b3b043489e889573d0033d8c354d5bffb39d8d4 100644 (file)
@@ -664,7 +664,7 @@ static void update_bootdev_config(struct platform_powerpc *platform,
                                                opt->uuid, delim);
                                break;
                        }
-                       tmp = val = talloc_asprintf_append(val, boot_str);
+                       tmp = val = talloc_asprintf_append(val, "%s", boot_str);
        }
 
        update_string_config(platform, "petitboot,bootdevs", val);