cpputools/source/sp2bv/sp2bv.cxx | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-)
New commits: commit 7c5188cbd483c1aab8c7bb55a29efcd935196fa1 Author: Arnaud VERSINI <arnaud.vers...@libreoffice.org> AuthorDate: Sun Mar 19 17:20:44 2023 +0100 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Aug 14 15:01:16 2023 +0200 sp2bv : no need to use fprintf without any formating Change-Id: Ieb276dcbd91873bd5121ae7534f0e120c88a88d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149114 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/cpputools/source/sp2bv/sp2bv.cxx b/cpputools/source/sp2bv/sp2bv.cxx index 9998e7cdb7c4..7e525f7fefcd 100644 --- a/cpputools/source/sp2bv/sp2bv.cxx +++ b/cpputools/source/sp2bv/sp2bv.cxx @@ -24,35 +24,34 @@ static bool hasOption(char const * szOption, int argc, char** argv); - -#define HELP_TEXT \ -"SYNOPSIS \n\n" \ -"\tsp2bv [-h] [-?] string \n\n" \ -"DESCRIPTION\n\n" \ -"\tsp2bv stands for \"system path to bootstrap variable\"." \ -" First the system path is converted into a file URL. Then all " \ -"characters which have a special meaning in bootstrap variables, " \ -"such as \'$\' are escaped. The resulting string is written to " \ -"stdout and can be assigned to a bootstrap variable.\n" \ -"\n\n" \ -"OPTIONS \n\n" \ -"\tThe following options are supported: \n" \ -"-?\n " \ -"--help" \ -" Display help information.\n" +const char* HELP_TEXT = + "SYNOPSIS \n\n" + "\tsp2bv [-h] [-?] string \n\n" + "DESCRIPTION\n\n" + "\tsp2bv stands for \"system path to bootstrap variable\"." + " First the system path is converted into a file URL. Then all " + "characters which have a special meaning in bootstrap variables, " + "such as \'$\' are escaped. The resulting string is written to " + "stdout and can be assigned to a bootstrap variable.\n" + "\n\n" + "OPTIONS \n\n" + "\tThe following options are supported: \n" + "-?\n " + "--help" + " Display help information.\n"; int main(int argc, char **argv) { if( hasOption("--help",argc, argv) || hasOption("-h", argc, argv)) { - fprintf(stdout, HELP_TEXT);// default + fputs(HELP_TEXT, stdout);// default return 0; } if (argc != 2) { - fprintf(stdout, HELP_TEXT); + fputs(HELP_TEXT, stdout); return -1; }