May as well move this test to before we try to sscanf: <code>
if (mean_mode || variance_mode)
{
    double x;
    if (1 == sscanf(...)) { ... }
}
</code> so as to save attempting to sscanf when a cheap pre-test could tell us its result is pointless anyway.