mirror of
https://github.com/Derisis13/Shutter.git
synced 2025-12-06 19:32:48 +01:00
Version 1.4.3
Bugfix: in function set_ch the address of channel was incremented instead of the value of it Bugfix: in function get_timing integers were read to byte sized fields causing memory corruption Updated and renamed moving_debug.c & moving_debug.h
This commit is contained in:
13
timing.c
13
timing.c
@@ -61,7 +61,7 @@ int find_next_day (FILE *f)
|
||||
|
||||
void get_timing (shutter *r, FILE *schedule)
|
||||
{
|
||||
int channel = 0;
|
||||
int tmp_min = 0, tmp_hour = 0, channel = 0, tmp_percentage = 0;
|
||||
while (channel != r->ch)
|
||||
{
|
||||
fscanf (schedule, "%*[^\n]s\n");
|
||||
@@ -71,14 +71,19 @@ void get_timing (shutter *r, FILE *schedule)
|
||||
}
|
||||
}
|
||||
|
||||
while (fscanf (schedule, "%d:%d", &r->up.tm_hour, &r->up.tm_min) != 2)
|
||||
while (fscanf (schedule, "%d:%d", &tmp_hour, &tmp_min) != 2)
|
||||
fscanf (schedule, "%*c");
|
||||
r->up.tm_hour = (char )tmp_hour;
|
||||
r->up.tm_min = (char )tmp_min;
|
||||
|
||||
while (fscanf (schedule, "%d:%d", &r->down.tm_hour, &r->down.tm_min) != 2)
|
||||
while (fscanf (schedule, "%d:%d", &tmp_hour, &tmp_min) != 2)
|
||||
fscanf (schedule, "%*c");
|
||||
r->down.tm_hour = (char )tmp_hour;
|
||||
r->down.tm_min = (char )tmp_min;
|
||||
|
||||
while (fscanf (schedule, "%d", &r->percentage) != 1)
|
||||
while (fscanf (schedule, "%d", &tmp_percentage) != 1)
|
||||
fscanf (schedule, "%*c");
|
||||
r->percentage = (char )tmp_percentage;
|
||||
|
||||
fscanf (schedule, "%*[^\n]s\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user