Changeset 210 for trunk/src/sh_getopt.c


Ignore:
Timestamp:
Jan 29, 2009, 7:54:16 PM (16 years ago)
Author:
katerina
Message:

Fix for ticket #136 (compile error); also enhance testsuite to catch compiler warnings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_getopt.c

    r183 r210  
    321321#ifndef DEFAULT_CONSOLE
    322322  if (num > 0) fputc ('\n', stdout);
    323   printf (_(" console (/dev/console)")); ++num;
     323  printf ("%s", _(" console (/dev/console)")); ++num;
    324324#else
    325325  if (num > 0) fputc ('\n', stdout);
    326326  if (0 == strcmp (DEFAULT_CONSOLE, _("NULL")))
    327     { printf (_("console (/dev/console)"));  ++num; }
     327    { printf ("%s", _("console (/dev/console)"));  ++num; }
    328328  else
    329329    { printf (_("console (%s)"), DEFAULT_CONSOLE);  ++num; }
     
    406406#if defined(USE_SYSTEM_MALLOC)
    407407  if (num > 0) fputc ('\n', stdout);
    408   printf (_(" using system malloc")); ++num;
     408  fputs (_(" using system malloc"), stdout); ++num;
    409409#else
    410410  if (num > 0) fputc ('\n', stdout);
    411   printf (_(" using dnmalloc")); ++num;
     411  fputs (_(" using dnmalloc"), stdout); ++num;
    412412#endif
    413413
     
    554554             "(c) 1999-2008 Rainer Wichmann (http://la-samhna.de).\n"),
    555555           VERSION);
    556   fprintf (stdout, _("This software comes with ABSOLUTELY NO WARRANTY. "));
    557   fprintf (stdout, _("Use at own risk.\n\n"));
     556  fprintf (stdout, "%s",_("This software comes with ABSOLUTELY NO WARRANTY. "));
     557  fprintf (stdout, "%s",_("Use at own risk.\n\n"));
    558558
    559559  sh_getopt_print_log_facilities ();
     
    567567static int sh_getopt_copyright (const char * dummy)
    568568{
    569   fprintf (stdout,
     569  fprintf (stdout, "%s",
    570570           _("Copyright (C) 1999-2008 Rainer Wichmann"\
    571571             " (http://la-samhna.de).\n\n"));
    572572
    573   fprintf (stdout,
     573  fprintf (stdout, "%s",
    574574           _("This program is free software; "\
    575575             "you can redistribute it and/or modify\n"));
    576   fprintf (stdout, _("it under the terms of the GNU General "\
     576  fprintf (stdout, "%s",_("it under the terms of the GNU General "\
    577577                     "Public License as published by\n"));
    578   fprintf (stdout, _("the Free Software Foundation; either version 2 "\
     578  fprintf (stdout, "%s",_("the Free Software Foundation; either version 2 "\
    579579                     "of the License, or\n"));
    580   fprintf (stdout, _("(at your option) any later version.\n\n"));
    581 
    582   fprintf (stdout, _("This program is distributed in the hope "\
     580  fprintf (stdout, "%s",_("(at your option) any later version.\n\n"));
     581
     582  fprintf (stdout, "%s",_("This program is distributed in the hope "\
    583583                     "that it will be useful,\n"));
    584   fprintf (stdout, _("but WITHOUT ANY WARRANTY; "\
     584  fprintf (stdout, "%s",_("but WITHOUT ANY WARRANTY; "\
    585585                     "without even the implied warranty of\n"));
    586   fprintf (stdout, _("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."\
    587                      " See the\n"));
    588   fprintf (stdout, _("GNU General Public License for more details.\n\n"));
    589 
    590   fprintf (stdout, _("You should have received a copy of the "\
     586  fprintf (stdout, "%s",_("MERCHANTABILITY or FITNESS FOR A PARTICULAR "\
     587                     "PURPOSE. See the\n"));
     588  fprintf (stdout, "%s",_("GNU General Public License for more details.\n\n"));
     589
     590  fprintf (stdout, "%s",_("You should have received a copy of the "\
    591591                     "GNU General Public License\n"));
    592   fprintf (stdout, _("along with this program; "\
     592  fprintf (stdout, "%s",_("along with this program; "\
    593593                     "if not, write to the Free Software\n"));
    594   fprintf (stdout, _("Foundation, Inc., 59 Temple Place - Suite 330, "\
     594  fprintf (stdout, "%s",_("Foundation, Inc., 59 Temple Place - Suite 330, "\
    595595                     "Boston, MA  02111-1307, USA.\n\n"));
    596596
    597   fprintf (stdout, _("This product makes use of the reference implementation "\
    598                      "of the TIGER message\n"));
    599   fprintf (stdout, _("digest algorithm. This code is copyright Eli Biham "\
     597  fprintf (stdout, "%s",_("This product makes use of the reference "\
     598                     "implementation of the TIGER message\n"));
     599  fprintf (stdout, "%s",_("digest algorithm. This code is copyright Eli Biham "\
    600600                     "(biham@cs.technion.ac.il)\n"));
    601   fprintf (stdout, _("and Ross Anderson (rja14@cl.cam.ac.uk). It can be used "\
     601  fprintf (stdout, "%s",_("and Ross Anderson (rja14@cl.cam.ac.uk). It can be used "\
    602602                     "freely without any\n"));
    603   fprintf (stdout, _("restrictions.\n"));
     603  fprintf (stdout, "%s",_("restrictions.\n"));
    604604#if defined(USE_SRP_PROTOCOL) && !defined(SH_STANDALONE)
    605605#if (!defined(HAVE_LIBGMP) || !defined(HAVE_GMP_H))
    606   fprintf (stdout, _("This product makes use of the 'bignum' library by "\
     606  fprintf (stdout, "%s",_("This product makes use of the 'bignum' library by "\
    607607                     "Henrik Johansson\n"));
    608   fprintf (stdout, _("(Henrik.Johansson@Nexus.Comm.SE). If you are including "\
    609                      "this library in a\n"));
    610   fprintf (stdout, _("commercial product, be sure to distribute ALL of"\
     608  fprintf (stdout, "%s",_("(Henrik.Johansson@Nexus.Comm.SE). If you are "\
     609                     "including this library in a\n"));
     610  fprintf (stdout, "%s",_("commercial product, be sure to distribute ALL of"\
    611611                     " it with the product.\n"));
    612612#endif
    613   fprintf (stdout, _("This product uses the 'Secure Remote Password' "\
     613  fprintf (stdout, "%s",_("This product uses the 'Secure Remote Password' "\
    614614                     "cryptographic\n"));
    615   fprintf (stdout, _("authentication system developed by Tom Wu "\
     615  fprintf (stdout, "%s",_("authentication system developed by Tom Wu "\
    616616                     "(tjw@CS.Stanford.EDU).\n"));
    617617#endif
    618   fprintf (stdout, _("\nPlease refer to the file COPYING in the source "\
     618  fprintf (stdout, "%s",_("\nPlease refer to the file COPYING in the source "\
    619619                     "distribution for a"));
    620   fprintf (stdout, _("\nfull list of incorporated code and associated "\
     620  fprintf (stdout, "%s",_("\nfull list of incorporated code and associated "\
    621621                     "licenses.\n"));
    622622
     
    644644             "(c) 1999-2006 Rainer Wichmann (http://la-samhna.de).\n"),
    645645           VERSION);
    646   fprintf (stdout, _("This software comes with ABSOLUTELY NO WARRANTY. "));
    647   fprintf (stdout, _("Use at own risk.\n"));
    648 
    649   fprintf (stdout, _("Usage:\n\n"));
     646  fprintf (stdout, "%s",_("This software comes with ABSOLUTELY NO WARRANTY. "));
     647  fprintf (stdout, "%s",_("Use at own risk.\n"));
     648
     649  fprintf (stdout, "%s",_("Usage:\n\n"));
    650650
    651651  for (i = 0; op_table[i].longopt != NULL; ++i) {
     
    656656    if (op_table[i].shortopt != '-' &&
    657657        strchr(opts, op_table[i].shortopt) != NULL)
    658       fprintf (stdout, _("Short option char collision !\n"));
     658      fprintf (stdout, "%s",_("Short option char collision !\n"));
    659659    opts[i] = op_table[i].shortopt;
    660660
     
    689689  }
    690690
    691   fprintf (stdout,
     691  fprintf (stdout, "%s",
    692692           _("\nPlease report bugs to support@la-samhna.de.\n"));
    693693
     
    767767                              /* not last option
    768768                               */
    769                               fprintf (stderr,
     769                              fprintf (stderr, "%s",
    770770                                       _("Error: short option with argument is not last in option string\n"));
    771771                              (void) sh_getopt_usage(_("fail"));
     
    775775                              /* argument required, but no avail
    776776                               */
    777                               fprintf (stderr, _("Error: missing argument\n"));
     777                              fprintf (stderr, "%s",
     778                                       _("Error: missing argument\n"));
    778779                              (void) sh_getopt_usage(_("fail"));
    779780                            }
     
    813814            {
    814815              /* unrecognized short option */
    815               fprintf (stderr, _("Error: unrecognized short option\n"));
     816              fprintf (stderr, "%s",_("Error: unrecognized short option\n"));
    816817              (void) sh_getopt_usage(_("fail"));
    817818            }
     
    840841                              /* argument required, but no avail
    841842                               */
    842                               fprintf (stderr, _("Error: missing argument\n"));
     843                              fprintf (stderr, "%s",
     844                                       _("Error: missing argument\n"));
    843845                              (void) sh_getopt_usage(_("fail"));
    844846                            }
     
    870872                          else
    871873                            {
    872                               fprintf (stderr, _("Error: invalid argument\n"));
     874                              fprintf (stderr, "%s",
     875                                       _("Error: invalid argument\n"));
    873876                              /* argument required, but no avail */
    874877                              (void) sh_getopt_usage(_("fail"));
     
    899902            {
    900903              /* unrecognized long option */
    901               fprintf (stderr, _("Error: unrecognized long option\n"));
     904              fprintf (stderr, "%s",_("Error: unrecognized long option\n"));
    902905              (void) sh_getopt_usage(_("fail"));
    903906            }
Note: See TracChangeset for help on using the changeset viewer.