libtt: Resolve all remaining format-security warnings.
authorPeter Howkins <flibble@users.sourceforge.net>
Sun, 26 Aug 2012 21:19:27 +0000 (22:19 +0100)
committerPeter Howkins <flibble@users.sourceforge.net>
Sun, 26 Aug 2012 21:19:27 +0000 (22:19 +0100)
cde/lib/tt/bin/dbck/options.C
cde/lib/tt/bin/dbck/spec.C
cde/lib/tt/bin/dbck/ttdbck.C
cde/lib/tt/bin/shell/copier.C
cde/lib/tt/bin/shell/mover.C
cde/lib/tt/bin/tt_type_comp/mp_types_table.C
cde/lib/tt/bin/tttar/archiver.C

index 930d6adc3b344b485e4dc36997f2304186e453d9..a0ef6bc9599f5a238756b35ac348cbbde3942c99 100644 (file)
@@ -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);
index 146afa51c5a4913b1e02aa51ab74d134235a23a1..97a0a5d3b92fdeacf7c9734c2c3a8f77ae258deb 100644 (file)
@@ -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);
                }
index c537b3bff66369983afbd0e05827a105df4d7ae5..0a11ab2ed04d862e9290827c36249bc8a9099231 100644 (file)
@@ -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;
index 276cda76a4f4596b92e84956d021988c4bf4ab5b..597a136e3a2b74686abcc507ff1de6acdb0d9819 100644 (file)
@@ -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"
index 6a412c0b7425e808dae92cd5d0b82e791e40355d..f3072380f97c930449ac0445ce497f64aa4538ac 100644 (file)
@@ -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"
index e861ac3b35beb3a5d002a72e0e666fc427726978..d62f290668dff1ed8e0bfe3489662bf19bd65b47 100644 (file)
@@ -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());
index 23288f1d2f7fa866be452c209c2992bd975bef21..4e11ec8545097ca57c6953c058e0c503acae681c 100644 (file)
@@ -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"