summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-02-25 12:20:25 +0100
committerDavid Herrmann <dh.herrmann@gmail.com>2014-02-25 12:22:31 +0100
commita1937e679f76758635d295287398abe526de2522 (patch)
treecd603e955ffdb264bfe5b2b08dd4b18240ff1038 /src/login
parent23fae27185ddde98706faac0f45d77b11ecd66e6 (diff)
login: fix pos-array allocation
GREEDY_REALLOC takes a pointer to the real size, not the array-width as argument. Therefore, our array is currently way to small to keep the seat positions. Introduce GREEDY_REALLOC0_T() as typed version of GREEDY_REALLOC and store the array-width instead of array-size.
Diffstat (limited to 'src/login')
-rw-r--r--src/login/logind-seat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c
index 631be5f740..36ec7ed757 100644
--- a/src/login/logind-seat.c
+++ b/src/login/logind-seat.c
@@ -475,7 +475,7 @@ void seat_claim_position(Seat *s, Session *session, unsigned int pos) {
if (seat_has_vts(s))
pos = session->vtnr;
- if (!GREEDY_REALLOC0(s->positions, s->position_count, pos + 1))
+ if (!GREEDY_REALLOC0_T(s->positions, s->position_count, pos + 1))
return;
seat_evict_position(s, session);