On Wednesday 30 June 2010 20:03:13 Linus Lüssing wrote:
- char msecs_buff[4];
- memset(msecs_buff, '0', sizeof(msecs_buff));
- msecs_buff[3] = '\0';
Shouldn't a simple memset(msecs_buff, 0, sizeof(msecs_buff)); be enough ?
if (sscanf(optarg, "%3d.%3s", &orig_timeout_secs,
else if (sscanf(optarg, "%3d", &orig_timeout_secs) == 1) { ; }
else {
I don't quite understand the sense of the "else if" here. You could also write: else if (sscanf(optarg, "%3d", &orig_timeout_secs) != 1) and write no else block but I don't see why 1 second should be accepted and nothing else ?
Regards, Marek