diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2008-12-16 06:59:56 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2008-12-16 06:59:56 +0100 |
commit | 616c8327a7b57dc4fedf5d1952a2b14559002fd8 (patch) | |
tree | 07b72ff008151f65ea3caa2900fe438017a449c6 /apt-pkg/contrib/strutl.cc | |
parent | bb3ac2f648764e7ee2a8cdc7739d56de6311c88f (diff) |
* apt-pkg/indexrecords.cc:
- fix some i18n issues
* apt-pkg/contrib/strutl.h:
- add new strprintf() function to make i18n strings easier
* apt-pkg/dev/debsystem.cc:
- add missing apti18n.h header
Diffstat (limited to 'apt-pkg/contrib/strutl.cc')
-rw-r--r-- | apt-pkg/contrib/strutl.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index bd374fd1e..cdd88827b 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -1032,6 +1032,21 @@ void ioprintf(ostream &out,const char *format,...) out << S; } /*}}}*/ +// strprintf - C format string outputter to C++ strings /*{{{*/ +// --------------------------------------------------------------------- +/* This is used to make the internationalization strings easier to translate + and to allow reordering of parameters */ +void strprintf(string &out,const char *format,...) +{ + va_list args; + va_start(args,format); + + // sprintf the description + char S[1024]; + vsnprintf(S,sizeof(S),format,args); + out = string(S); +} + /*}}}*/ // safe_snprintf - Safer snprintf /*{{{*/ // --------------------------------------------------------------------- /* This is a snprintf that will never (ever) go past 'End' and returns a |