]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/cmndline.cc
switch from std::set to std::vector as it is way more simple, a bit
[apt.git] / apt-pkg / contrib / cmndline.cc
index 0b16bf51a5387d469d2a0857d510c3d0f0d9b0c3..5a994409663e299b6e4ca6991f1a13ba28950709 100644 (file)
@@ -360,11 +360,11 @@ bool CommandLine::DispatchArg(Dispatch *Map,bool NoMatch)
    than nothing after all. */
 void CommandLine::SaveInConfig(unsigned int const &argc, char const * const * const argv)
 {
-   char cmdline[300];
+   char cmdline[100 + argc * 50];
    unsigned int length = 0;
    bool lastWasOption = false;
    bool closeQuote = false;
-   for (unsigned int i = 0; i < argc; ++i, ++length)
+   for (unsigned int i = 0; i < argc && length < sizeof(cmdline); ++i, ++length)
    {
       for (unsigned int j = 0; argv[i][j] != '\0' && length < sizeof(cmdline)-1; ++j, ++length)
       {