I had to remove dependance on the standard STL library, otherwise server
admins were getting a cannot find libstd error.
I cant believe the code got so muddled in the original mails, no line breaks
:\

But yeah, I re-wrote it removing Valve's functions and its working but I
thought the reason for these functions was to help us. Most of them aren't
used in the SDK at all, so what are they there for?

---------------------------------------------
CUtlVector<char*, CUtlMemory<char*> > outStrings;
const char *sToDo = "gren, pans, heli";
Q_SplitString( sToDo, ",", outStrings );
char sTmp[25] = "";
int x = 0;
for ( x = 0; x < outStrings.Count(); x++ )
{
        Q_StrSubst( outStrings[x], " ", "", sTmp, 25, true );
        META_LOG( g_PLAPI, "String:'%s'", sTmp );
}
Q_strcpy( sTmp, "" );
outStrings.PurgeAndDeleteElements();
return;
---------------------------------------------
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:hlcoders-
> [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
> Sent: 06 May 2006 19:07
> To: hlcoders@list.valvesoftware.com
> Subject: Re: [hlcoders] VSTDLIB Whoes.
>
> I'd highly recommend avoiding those CUtl things in that context.  Just use
> regular STL unless you're dealing with a Valve interface that demands
> something else.  STL is much more robust and easier to debug.
>
> At 2006/05/04 08:58 AM, Jay C. wrote:
> >I'm trying (unsuccessfully) to use some of the VSTBLIB functions provided
> in
> >strtools.h
> >
> >I have the following code, which when run in the IDE gives me a user
> >breakpoint in free.c:101 - HeapFree.
> >When I run it compiled it crashes SRCDS.
> >
> >---------------------------------------------
> >
> >CUtlVector<char*, CUtlMemory<char*> > outStrings;
> >const char *sToDo = "gren, pans, heli";
> >Q_SplitString( sToDo, ",", outStrings );
> >char sTmp[25] = "";
> >int x = 0;
> >for ( x = 0; x < outStrings.Count(); x++ )
> >{
> >        Q_StrSubst( outStrings[x], " ", "", sTmp, 25, true );
> >        META_LOG( g_PLAPI, "String:'%s'", sTmp );
> >}
> >Q_strcpy( sTmp, "" );
> >outStrings.PurgeAndDeleteElements();
> >return;
> >
> >---------------------------------------------
> >
> >It stops when I remove PurgeandDeleteElements() but then I'm causing
> memory
> >leaks :\
> >
> >Has anyone else had this problem or anything related?
> >
> >Thanks
> >- Jason Croghan
> >
> >
> >_______________________________________________
> >To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> >http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>



_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to