[Coin-discuss] CoinStrdup warning
    Matthew Galati 
    magh at lehigh.edu
       
    Sun Nov 16 10:41:43 EST 2008
    
    
  
Can someone please cleanup this warning? It is an easy one.Thanks. Matt
1>c:\cygwin\home\magala\COIN\coin-Decomp\CoinUtils\src\CoinHelperFunctions.hpp(501) 
: warning C4267: 'initializing' : conversion from 'size_t' to 'const 
int', possible loss of data
/** Returns strdup or NULL if original NULL */
inline char * CoinStrdup(const char * name)
{
  char* dup = NULL;
  if (name) {
    const int len = strlen(name);
    dup = (char*)malloc(len+1);
    CoinMemcpyN(name, len, dup);
    dup[len] = 0;
  }
  return dup;
}
    
    
More information about the Coin-discuss
mailing list