Fix snprintf length usage