ns-allinone-2.35/nam-1.15/trafficsource.cc
void
TimeList::getListString(char * buffer, int buffer_size) {
	int total_written, just_written;
	TimeElement * run;

	total_written = 1; // Need space for the /0 character
	for (run = head_; run; run = run->next_) {
		just_written = sprintf(buffer, 
					"%f ", run->time_);

		if (just_written == -1) {
			fprintf(stderr, "Ran out of buffer space when creating time list string\n");
			break;
		}
		//Advance buffer pointer past written characters
		buffer += just_written;
		total_written += just_written;
	}
}
//----------------------------------------------------------------------
// void 
// TimeList::getListString(char * buffer, int buffer_size)
//   - fills buffer with a space delimited list of all values on the
//     time list sorted in ascending order
//
//   - the returned list should be freed when it is not needed anymore
//----------------------------------------------------------------------
void
TimeList::getListString(char * buffer, int buffer_size)
fills buffer with a space delimited list of all values on the
time list sorted in ascending order

the returned list should be freed when it is not needed anymore
void TimeList :: getListString ( char * buffer int buffer_size ) fills buffer with a space delimited list of all values on the time list sorted in ascending order the returned list should be freed when it is not needed anymore
void
TimeList::getListString(char * buffer, int buffer_size) {
	int total_written, just_written;
	TimeElement * run;
	total_written = 1; 
	for (run = head_; run; run = run->next_) {
		just_written = sprintf(buffer, 
					"%f ", run->time_);
		if (just_written == -1) {
			fprintf(stderr, "Ran out of buffer space when creating time list string\n");
			break;
		}
		buffer += just_written;
		total_written += just_written;
	}
}
void TimeList :: getListString ( char * buffer , int buffer_size ) { int total_written , just_written ; TimeElement * run ; total_written = 1 ; for ( run = head_ ; run ; run = run -> next_ ) { just_written = sprintf ( buffer , " " , run -> time_ ) ; if ( just_written == -1 ) { fprintf ( stderr , " \n " ) ; break ; } buffer += just_written ; total_written += just_written ; } }
void
TimeList::getListString(char * buffer, int buffer_size)
 fills buffer with a space delimited list of all values on the
time list sorted in ascending order
void TimeList :: getListString ( char * buffer int buffer_size ) fills buffer with a space delimited list of all values on the time list sorted in ascending order
// Need space for the /0 character //Advance buffer pointer past written characters