(Another 64-bit fix)

This commit is contained in:
BlackLight 2011-02-10 00:56:08 +01:00
parent 0636a82ec2
commit 829a6d3616

View file

@ -161,15 +161,15 @@ char*
str_replace ( char *str, const char *pattern, const char *sub ) str_replace ( char *str, const char *pattern, const char *sub )
{ {
char *new_s = NULL; char *new_s = NULL;
unsigned int pos = 0, unsigned long int pos = 0,
new_len = 0; new_len = 0;
if ( !( pos = (unsigned int) strstr ( str, pattern ))) if ( !( pos = (unsigned long int) strstr ( str, pattern )))
{ {
return strdup ( str ); return strdup ( str );
} }
pos -= (unsigned int) str; pos -= (unsigned long int) str;
new_len = strlen ( str ) - strlen ( pattern ) + ((sub) ? strlen ( sub ) : 0); new_len = strlen ( str ) - strlen ( pattern ) + ((sub) ? strlen ( sub ) : 0);
if ( !( new_s = (char*) malloc ( new_len + 1 ))) if ( !( new_s = (char*) malloc ( new_len + 1 )))