[Nut-upsdev] [nut-commits] svn commit r2594 - branches/bcmxcp/drivers

Arjen de Korte nut+devel at de-korte.org
Wed Oct 20 14:16:06 UTC 2010


Citeren Chetan Agarwal <chetanagarwal-guest op alioth.debian.org>:

> +	sPartNumber[16] = 0;

This is redundant. The snprintf function will take care of properly  
terminating the string with a '\0' character, you don't need to do  
that yourself.

> +	snprintf(sPartNumber, 16, "%s", answer + BCMXCP_CONFIG_BLOCK_PART_NUMBER);

Don't hardcode '16' here, use 'sizeof(sPartNumber)' instead.

Best regards, Arjen
-- 
Please keep list traffic on the list (off-list replies will be rejected)




More information about the Nut-upsdev mailing list