add_tag_for_client(): Set time_to_live properly
authorFabian Keil <fk@fabiankeil.de>
Mon, 20 Feb 2017 13:47:51 +0000 (13:47 +0000)
committerFabian Keil <fk@fabiankeil.de>
Mon, 20 Feb 2017 13:47:51 +0000 (13:47 +0000)
Previously the time_to_live was always set for the first tag.
Attempts to temporarily enable a tag would result in enabling
it permanently unless no tag was enabled already.

D'oh.

client-tags.c

index f9b38c9..d981688 100644 (file)
@@ -372,7 +372,7 @@ static void add_tag_for_client(const char *client_address,
       {
          enabled_tags->next = zalloc_or_die(sizeof(struct client_specific_tag));
          enabled_tags->next->name = strdup_or_die(tag);
-         clients_with_tags->tags->end_of_life = time_to_live ?
+         enabled_tags->next->end_of_life = time_to_live ?
             (time(NULL) + time_to_live) : 0;
          enabled_tags->next->prev = enabled_tags;
          break;