Opened 9 years ago

Closed 9 years ago

#44 closed defect (fixed)

change max characters in Clp_problem name

Reported by: kmartin Owned by: somebody
Priority: minor Milestone:
Component: component1 Version:
Keywords: Cc:

Description

/* ORIGINAL VERSION From Clp_C_Interface.cpp */

/* Fills in array with problem name */ COINLIBAPI void COINLINKAGE Clp_problemName(Clp_Simplex * model, int maxNumberCharacters, char * array) {

std::string name = model->model_->problemName(); maxNumberCharacters = CoinMin?(maxNumberCharacters,(int)strlen(name.c_str())); strncpy(array,name.c_str(),maxNumberCharacters-1); array[maxNumberCharacters-1]='\0';

}

/* maxNumberCharacters should be allowed to be 1+(int)strlen(name.c_str()) if possible, so as not to lose the last character of the problem name. */

/* CORRECTED VERSION */

/* Fills in array with problem name */ COINLIBAPI void COINLINKAGE Clp_problemName(Clp_Simplex * model, int maxNumberCharacters, char * array) {

std::string name = model->model_->problemName(); maxNumberCharacters = CoinMin?(maxNumberCharacters,1+(int)strlen(name.c_str())); strncpy(array,name.c_str(),maxNumberCharacters-1); array[maxNumberCharacters-1]='\0';

}

Change History (1)

comment:1 Changed 9 years ago by lou

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in trunk r1689.

Note: See TracTickets for help on using tickets.