MCPcopy Create free account
hub / github.com/black-sliver/PopTracker / tfd_replaceSubStr

Function tfd_replaceSubStr

lib/tinyfiledialogs/tinyfiledialogs.cpp:328–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326
327
328void tfd_replaceSubStr( char const * aSource, char const * aOldSubStr,
329 char const * aNewSubStr, char * aoDestination )
330{
331 char const * pOccurence ;
332 char const * p ;
333 char const * lNewSubStr = "" ;
334 size_t lOldSubLen = strlen( aOldSubStr ) ;
335
336 if ( ! aSource )
337 {
338 * aoDestination = '\0' ;
339 return ;
340 }
341 if ( ! aOldSubStr )
342 {
343 strcpy( aoDestination , aSource ) ;
344 return ;
345 }
346 if ( aNewSubStr )
347 {
348 lNewSubStr = aNewSubStr ;
349 }
350 p = aSource ;
351 * aoDestination = '\0' ;
352 while ( ( pOccurence = strstr( p , aOldSubStr ) ) != NULL )
353 {
354 strncat( aoDestination , p , pOccurence - p ) ;
355 strcat( aoDestination , lNewSubStr ) ;
356 p = pOccurence + lOldSubLen ;
357 }
358 strcat( aoDestination , p ) ;
359}
360
361
362static int filenameValid( char const * aFileNameWithoutPath )

Callers 4

messageBoxWinConsoleFunction · 0.85
tinyfd_messageBoxFunction · 0.85
tinyfd_notifyPopupFunction · 0.85
tinyfd_inputBoxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected