[vorbis-dev] More changes to the win32 build environment

Chris Wolf cwolf at starclass.com
Sun Oct 21 13:36:10 PDT 2001



All right, I checked in a version which not only deals with the extra byte
for the space (" "), but also supports arbitrarily long command lines
using a dynamic buffer.  

I hear you on the automatic strings ;) -- your're talking about std::string, right?

        -Chris

On 10/21/2001 at 2:43 PM Matthijs Laan wrote:

>On Sat 20 Oct 2001 23:43:07, "Chris Wolf" <cwolf at starclass.com> wrote:
>
>> I made some changes to the win32 build environment.
>
>Working great!
>
>Just found a bug in my code:
>
>  for(i=1;i<argc;i++)
>  {
>    if(strlen(argv[i])>(size_t)(BUF_SIZE-c))
>    {
>      (void)fprintf(stderr, "Command line too long\n");
>      exit(1);
>    }
>
>    strcat(cmdline, argv[i]);
>    strcat(cmdline, " ");
>    c+=strlen(argv[i]);
>  }
>
>Should of course be
>
>  for(i=1;i<argc;i++)
>  {
>    if((strlen(argv[i])+strlen(" "))>(size_t)(BUF_SIZE-c))
>    {
>      (void)fprintf(stderr, "Command line too long\n");
>      exit(1);
>    }
>
>    strcat(cmdline, argv[i]);
>    strcat(cmdline, " ");
>    c+=strlen(argv[i])+strlen(" ");
>  }
>
>That's what you get when you're spoiled with automatic strings...
>
>Matthijs
>
>--- >8 ----
>List archives:  http://www.xiph.org/archives/
>Ogg project homepage: http://www.xiph.org/ogg/
>To unsubscribe from this list, send a message to
>'vorbis-dev-request at xiph.org'
>containing only the word 'unsubscribe' in the body.  No subject is needed.
>Unsubscribe messages sent to the list will be ignored/filtered.

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list