c
int temp;
if (sscanf(optarg, "%d", &temp) == 1 && temp > 0) {
    horizSubSampling = temp;
} else {
    fprintf(stderr, "Error: Invalid horizontal subsampling value.\n");
    exit(1);
}
