On mer, 2010-12-08 at 20:26 +0000, Spencer Oliver wrote: > > - printed = snprintf(buf, buf_size, "typ. word write timeout: %u, > " > - "typ. buf write timeout: %u, typ. block erase > timeout: %u, typ. chip erase timeout: %u\n", > + printed = snprintf(buf, buf_size, "typ. word write timeout: %u > us, " > + "typ. buf write timeout: %u us, " > + "typ. block erase timeout: %u ms, " > + "typ. chip erase timeout: %u ms\n", > 1 << cfi_info->word_write_timeout_typ, > 1 << cfi_info->buf_write_timeout_typ, > 1 << cfi_info->block_erase_timeout_typ, > @@ -2870,8 +2872,9 @@ static int get_cfi_info(struct flash_bank *bank, char > *buf, int buf_size) > buf += printed; > buf_size -= printed; > > - printed = snprintf(buf, buf_size, "max. word write timeout: %u, > " > - "max. buf write timeout: %u, max. block erase > timeout: %u, max. chip erase timeout: %u\n", > + printed = snprintf(buf, buf_size, "max. word write timeout: %u > us, " > + "max. buf write timeout: %u us, max. " > + "block erase timeout: %u ms, max. chip erase > timeout: %u ms\n",
Nitpicking comment: you should also add buf[buf_size - 1] = '\0'; before the end of the function, as snprintf() doesn't guarantee that if you print more than buf_size chars. Regards, -- Luca Ottaviano - [email protected] Develer S.r.l. - http://www.develer.com/ .hardware .software .innovation Tel.: +39 055 3986627 - ext.: 218 _______________________________________________ Openocd-development mailing list [email protected] https://lists.berlios.de/mailman/listinfo/openocd-development
