On Feb 5, 2004, at 3:32 PM, Olivier Biot wrote:


Should the check for the start of the column data be:
  if (cinfo->col_data[0]) {
    col_append_str(cinfo, el, separator ? separator : ", ");
  }
or should I use cinfo->col_buf[0] in the conditional addition of the
separator?

If you're appending to a column, then either the column was set by "col_set_str()", in which case the string pointed to by "col_data" has to be copied to "col_buf", or it wasn't set by "col_set_str()" or has subsequently be changed by another "col_" routine, in which case "col_data" just points to "col_buf".


That's handled by "COL_CHECK_APPEND()".

Therefore, it's just a matter of style; "col_append_str()" and "col_append_fstr()" use "col_buf", so I'd use "col_buf". (The idea is that you're updating the buffer.)

_______________________________________________
Ethereal-dev mailing list
[EMAIL PROTECTED]
http://www.ethereal.com/mailman/listinfo/ethereal-dev

Reply via email to