]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/strutl.cc
apt-pkg/contrib/strutl.cc: increase the size limit
[apt.git] / apt-pkg / contrib / strutl.cc
index eacc7077ad36f7fc82c72bbbbe6c7ec16c29c843..98d9c41e43b213deb5f8231d9938c97679d6a771 100644 (file)
@@ -459,9 +459,9 @@ string Base64Encode(const string &S)
    return Final;
 }
                                                                        /*}}}*/
-// stringcmp - Arbitary string compare                                 /*{{{*/
+// stringcmp - Arbitrary string compare                                        /*{{{*/
 // ---------------------------------------------------------------------
-/* This safely compares two non-null terminated strings of arbitary 
+/* This safely compares two non-null terminated strings of arbitrary 
    length */
 int stringcmp(const char *A,const char *AEnd,const char *B,const char *BEnd)
 {
@@ -517,7 +517,7 @@ int stringcmp(string::const_iterator A,string::const_iterator AEnd,
 }
 #endif
                                                                        /*}}}*/
-// stringcasecmp - Arbitary case insensitive string compare            /*{{{*/
+// stringcasecmp - Arbitrary case insensitive string compare           /*{{{*/
 // ---------------------------------------------------------------------
 /* */
 int stringcasecmp(const char *A,const char *AEnd,const char *B,const char *BEnd)
@@ -1027,11 +1027,26 @@ void ioprintf(ostream &out,const char *format,...)
    va_start(args,format);
    
    // sprintf the description
-   char S[400];
+   char S[4096];
    vsnprintf(S,sizeof(S),format,args);
    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[4096];
+   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