2 // start werktijd in seconden
3 str_ptr = strrchr(s_1, 0); // find end of str
4 m = atoi(str_ptr -= 2); // extract minutes
5 tydblok.tm_min = m; // fill minutes
6 *str_ptr = 0; // kill str after hours
7 h = atoi(str_ptr -= 2); // extract hours
8 tydblok.tm_hour = h; // fill hours
9 b_w_time = mktime(&tydblok);// calculate time in secs
Mostly all goes well. Sometimes e.g. "0233" as string happens as follows:
line 7: h becomes 2, tm_hour = 3 (previous value).
line 8: h stays 2, tm_hour becomes 2 (all seems well).
line 9: b_w_time becomes too small value and tm_hour changed to 1 ???