From 33c16917666bae31efffde7c82e896bc2a690a14 Mon Sep 17 00:00:00 2001 From: Oliver Freyermuth Date: Tue, 2 Apr 2019 20:19:46 +0200 Subject: [PATCH] cups-browsed: Fix broken trailing space removal on "NickName". The code tried to remove trailing spaces, but if there was at least one trailing space, the last two characters of the line were removed. This caused removal of the quotation mark in case exactly one trailing space was present, breaking the PPD and subsequently causing CUPS to mess up all queues (even local ones). Signed-off-by: Oliver Freyermuth --- utils/cups-browsed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/cups-browsed.c b/utils/cups-browsed.c index ac4392012..1e3ba18c6 100644 --- a/utils/cups-browsed.c +++ b/utils/cups-browsed.c @@ -5277,8 +5277,8 @@ gboolean update_cups_queues(gpointer unused) { memmove(ptr, prefix, strlen(prefix)); ptr = line + strlen(line) - 1; while(isspace(*ptr) && ptr > line) { - ptr --; *ptr = '\0'; + ptr --; } if (*ptr != '"') { if (ptr < line + sizeof(line) - 2) { -- 2.47.2