From 8479d150e2b8336aaf6e57cb76b9c3c0e55934e3 Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Sun, 26 Aug 2012 22:19:27 +0100 Subject: [PATCH] libtt: Resolve all remaining format-security warnings. --- cde/lib/tt/bin/dbck/options.C | 16 ++++++++-------- cde/lib/tt/bin/dbck/spec.C | 10 +++++----- cde/lib/tt/bin/dbck/ttdbck.C | 8 ++++---- cde/lib/tt/bin/shell/copier.C | 2 +- cde/lib/tt/bin/shell/mover.C | 2 +- cde/lib/tt/bin/tt_type_comp/mp_types_table.C | 2 +- cde/lib/tt/bin/tttar/archiver.C | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/cde/lib/tt/bin/dbck/options.C b/cde/lib/tt/bin/dbck/options.C index 930d6adc3..a0ef6bc95 100644 --- a/cde/lib/tt/bin/dbck/options.C +++ b/cde/lib/tt/bin/dbck/options.C @@ -157,7 +157,7 @@ print(FILE *f) const (char *)_sel_filename); } if (_sel_objid_p) { - fprintf(f,catgets(_ttcatd, 6, 8, "Select by objid key:")); + fprintf(f, "%s", catgets(_ttcatd, 6, 8, "Select by objid key:")); _sel_objid_key->print(f); fprintf(f,"\n"); } @@ -166,25 +166,25 @@ print(FILE *f) const (char *)_sel_type); } if (_diag_badform_p) { - fprintf(f,catgets(_ttcatd, 6, 10, + fprintf(f, "%s", catgets(_ttcatd, 6, 10, "Diagnose badly formed entities\n")); } if (_diag_exist_p) { - fprintf(f,catgets(_ttcatd, 6, 11, "Diagnose references to " + fprintf(f, "%s", catgets(_ttcatd, 6, 11, "Diagnose references to " "non-existent entities\n")); } if (_disp_id_p) { - fprintf(f,catgets(_ttcatd, 6, 12, "Display ids\n")); + fprintf(f, "%s", catgets(_ttcatd, 6, 12, "Display ids\n")); } if (_disp_mand_p) { - fprintf(f,catgets(_ttcatd, 6, 13, "Display mandatory data\n")); + fprintf(f, "%s", catgets(_ttcatd, 6, 13, "Display mandatory data\n")); } if (_disp_prop_p) { - fprintf(f,catgets(_ttcatd, 6, 14, + fprintf(f, "%s", catgets(_ttcatd, 6, 14, "Display properties and values data\n")); } if (_repair_netisam_p) { - fprintf(f,catgets(_ttcatd, 6, 15, + fprintf(f, "%s", catgets(_ttcatd, 6, 15, "Invoke NetISAM isrepair() function before " "inspecting\n")); } @@ -194,7 +194,7 @@ print(FILE *f) const (char *)_repair_type); } if (_repair_delete_p) { - fprintf(f,catgets(_ttcatd, 6, 17, "Repair by deleting\n")); + fprintf(f, "%s", catgets(_ttcatd, 6, 17, "Repair by deleting\n")); } fprintf(f,catgets(_ttcatd, 6, 18, "Debugging printout level %d\n"), _debug_level); diff --git a/cde/lib/tt/bin/dbck/spec.C b/cde/lib/tt/bin/dbck/spec.C index 146afa51c..97a0a5d3b 100644 --- a/cde/lib/tt/bin/dbck/spec.C +++ b/cde/lib/tt/bin/dbck/spec.C @@ -280,11 +280,11 @@ process_spec() // way through and put the spec on the repair list. if ((bad_flags & BAD_NOFILE)!=0) { - printf(catgets(_ttcatd, 6, 20, + printf("%s", catgets(_ttcatd, 6, 20, "Error: no file for spec.\n")); } if ((bad_flags & BAD_NOTYPE)!=0) { - printf(catgets(_ttcatd, 6, 21, + printf("%s", catgets(_ttcatd, 6, 21, "Error: no type for spec.\n")); } if ((bad_flags & BAD_TYPE)!=0) { @@ -293,16 +293,16 @@ process_spec() type.operator const char *()); } if ((bad_flags & BAD_MULTITYPE)!=0) { - printf(catgets(_ttcatd, 6, 23,"Error: spec has multiple " + printf("%s", catgets(_ttcatd, 6, 23,"Error: spec has multiple " "values for type property.\n")); } if ((bad_flags & BAD_FILE_STAT)!=0) { - printf(catgets(_ttcatd, 6, 24,"Error: ")); + printf("%s", catgets(_ttcatd, 6, 24,"Error: ")); printf("%s: %s", (char *)filename, strerror(save_errno)); } if ((bad_flags & BAD_TYPED_FILESPEC)!=0) { - printf(catgets(_ttcatd, 6, 26,"Error: ")); + printf("%s", catgets(_ttcatd, 6, 26,"Error: ")); printf("%s: internal spec for file has an otype.\n", (char *)filename); } diff --git a/cde/lib/tt/bin/dbck/ttdbck.C b/cde/lib/tt/bin/dbck/ttdbck.C index c537b3bff..0a11ab2ed 100644 --- a/cde/lib/tt/bin/dbck/ttdbck.C +++ b/cde/lib/tt/bin/dbck/ttdbck.C @@ -142,7 +142,7 @@ main(int argc, char **argv) if (!opts->set_opts(argc, argv)) { - fprintf(stderr, catgets(_ttcatd, 6, 2, + fprintf(stderr, "%s", catgets(_ttcatd, 6, 2, "Usage:\n" "ttdbck [-f file] [-k objkey] [-t type] [-bx] \n" "[-impa] [-IZ] [-F newfilename] [-T newtype] [mountpoints]\n")); @@ -156,7 +156,7 @@ main(int argc, char **argv) if (opts->repairing_p() && !opts->selecting_p() && !opts->diagnosing_p()) { - fprintf(stderr, + fprintf(stderr, "%s", catgets(_ttcatd, 6, 3, "ttdbck: you must specify a selection " "[-fkt] option or a diagnosis [-bx] option\n" @@ -201,7 +201,7 @@ main(int argc, char **argv) // already been output. if (status==0) { - fprintf(stderr, + fprintf(stderr, "%s", catgets(_ttcatd, 6, 25, "ttdbck: no errors found.\n")); } @@ -592,7 +592,7 @@ pisamerr(const char *func, const char *name) } switch (iserrno) { case EBADFILE: - fprintf(stderr, + fprintf(stderr, "%s", catgets(_ttcatd, 6, 6, "ttdbck: try 'ttdbck -I'.\n")); break; diff --git a/cde/lib/tt/bin/shell/copier.C b/cde/lib/tt/bin/shell/copier.C index 276cda76a..597a136e3 100644 --- a/cde/lib/tt/bin/shell/copier.C +++ b/cde/lib/tt/bin/shell/copier.C @@ -466,7 +466,7 @@ usage(FILE *fs) const " %s -h\n"), (char *)_prog_name, (char *)_prog_name, (char *)_prog_name, (char *)_prog_name ); - fprintf( fs, + fprintf( fs, "%s", catgets(_ttcatd, 8, 14, "\t-L do not perform a cp(1)\n" "\t-v print the version number and quit\n" diff --git a/cde/lib/tt/bin/shell/mover.C b/cde/lib/tt/bin/shell/mover.C index 6a412c0b7..f3072380f 100644 --- a/cde/lib/tt/bin/shell/mover.C +++ b/cde/lib/tt/bin/shell/mover.C @@ -382,7 +382,7 @@ usage(FILE *fs) const " %s -h\n"), (char *)_prog_name, (char *)_prog_name, (char *)_prog_name, (char *)_prog_name ); - fprintf( fs, + fprintf( fs, "%s", catgets(_ttcatd, 8, 6, "\t-L do not perform a mv(1)\n" "\t-v print the version number and quit\n" diff --git a/cde/lib/tt/bin/tt_type_comp/mp_types_table.C b/cde/lib/tt/bin/tt_type_comp/mp_types_table.C index e861ac3b3..d62f29066 100644 --- a/cde/lib/tt/bin/tt_type_comp/mp_types_table.C +++ b/cde/lib/tt/bin/tt_type_comp/mp_types_table.C @@ -474,7 +474,7 @@ check_cycle(_Tt_otype_ptr otype, _Tt_otype **path, int top) } else { for (int i = 0; i <= top-1; i++) { if (path[i] == anc_otype.c_pointer()) { - fprintf(stderr, + fprintf(stderr, "%s", catgets(_ttcatd, 4, 38, "cyclic otype inheritance hierarchy -\n {")); for (int j = i; j <= top-1; j++) { fprintf(stderr," %s", (char *) path[j]->otid()); diff --git a/cde/lib/tt/bin/tttar/archiver.C b/cde/lib/tt/bin/tttar/archiver.C index 23288f1d2..4e11ec854 100644 --- a/cde/lib/tt/bin/tttar/archiver.C +++ b/cde/lib/tt/bin/tttar/archiver.C @@ -551,7 +551,7 @@ usage( FILE *fs ) const " %s -h\n"), (char *)_prog_name, (char *)_prog_name, (char *)_prog_name, (char *)_prog_name ); - fprintf( fs, + fprintf( fs, "%s", catgets(_ttcatd, 7, 3, "\tc create an archive\n" "\tt list an archive's contents\n"