Use the variable instead of type for sizeof.

This commit is contained in:
Roy Marples
2008-01-30 15:01:37 +00:00
parent 3506cb2dc7
commit 84ad9a40a6
5 changed files with 14 additions and 14 deletions

View File

@@ -215,13 +215,13 @@ static void parse_schedule (const char *string, int default_signal)
if (schedule)
free_schedulelist (&schedule);
schedule = xmalloc (sizeof (schedulelist_t));
schedule = xmalloc (sizeof (*schedule));
schedule->gotolist = NULL;
if (count == 0) {
schedule->type = schedule_signal;
schedule->value = default_signal;
schedule->next = xmalloc (sizeof (schedulelist_t));
schedule->next = xmalloc (sizeof (*schedule->next));
next = schedule->next;
next->type = schedule_timeout;
next->gotolist = NULL;
@@ -261,14 +261,14 @@ static void parse_schedule (const char *string, int default_signal)
}
if (string) {
next->next = xmalloc (sizeof (schedulelist_t));
next->next = xmalloc (sizeof (*next->next));
next = next->next;
next->gotolist = NULL;
}
}
if (repeatat) {
next->next = xmalloc (sizeof (schedulelist_t));
next->next = xmalloc (sizeof (*next->next));
next = next->next;
next->type = schedule_goto;
next->value = 0;